@pega/cosmos-react-test-utils 10.0.0-build.15.2 → 10.0.0-build.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +2 -2
- package/lib/utils/utils.js.map +1 -1
- package/package.json +2 -2
package/lib/utils/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAW7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,KAAK,cAAc,GAAG,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAmBjE,wBAAgB,MAAM,CACpB,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC,EAC1D,kBAAkB,CAAC,EAAE,cAAc,GAClC,YAAY,CAAC;AAEhB,wBAAgB,MAAM,CACpB,CAAC,SAAS,OAAO,GAAG,OAAO,OAAO,EAClC,SAAS,SAAS,OAAO,GAAG,gBAAgB,GAAG,WAAW,EAC1D,WAAW,SAAS,OAAO,GAAG,gBAAgB,GAAG,SAAS,EAE1D,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,SAAS,CAAC,EACxE,kBAAkB,CAAC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Ac,KAClC,YACiF,CAAC;AAErF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,SAIhD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,WAAW,EAAE,eAAe,WAAW,SAK5E,CAAC;AAEF,eAAO,MAAM,kBAAkB,iDAE7B,CAAC"}
|
package/lib/utils/utils.js
CHANGED
|
@@ -3,14 +3,14 @@ import { fireEvent, render as rtlRender } from '@testing-library/react';
|
|
|
3
3
|
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
|
|
4
4
|
import { Configuration, LiveLog, ModalManager, PopoverManager, PreviewManager, Toaster } from '@pega/cosmos-react-core';
|
|
5
5
|
export { default as getHighlightMocks } from '../mocks/highlightMock';
|
|
6
|
-
const Providers = (configurationProps) => ({ children }) => (_jsx(Configuration, { ...configurationProps, children: _jsx(LiveLog, { children: _jsx(PopoverManager, { children: _jsx(PreviewManager, { children: _jsx(Toaster, { children: _jsx(ModalManager, { children: children }) }) }) }) }) }));
|
|
6
|
+
const Providers = (configurationProps) => ({ children }) => (_jsx(Configuration, { staticServerURL: window.location.origin, ...configurationProps, children: _jsx(LiveLog, { children: _jsx(PopoverManager, { children: _jsx(PreviewManager, { children: _jsx(Toaster, { children: _jsx(ModalManager, { children: children }) }) }) }) }) }));
|
|
7
7
|
export function render(content, options = {}, configurationProps) {
|
|
8
8
|
return rtlRender(content, {
|
|
9
9
|
...options,
|
|
10
10
|
wrapper: Providers(configurationProps)
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
const ConfigurationOnly = (configurationProps) => ({ children }) => (_jsx(Configuration, { ...configurationProps, children: children }));
|
|
13
|
+
const ConfigurationOnly = (configurationProps) => ({ children }) => (_jsx(Configuration, { staticServerURL: window.location.origin, ...configurationProps, children: children }));
|
|
14
14
|
// Skips LiveLog and the managers, whose extra DOM (log regions, headings) breaks exact-DOM assertions.
|
|
15
15
|
export const renderOnlyWithConfiguration = (content, options, configurationProps) => rtlRender(content, { ...options, wrapper: ConfigurationOnly(configurationProps) });
|
|
16
16
|
export const resizeWindow = (x, y) => {
|
package/lib/utils/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxE,OAAO,SAAS,EAAE,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,cAAc,EACd,cAAc,EACd,OAAO,EACR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,SAAS,GACb,CAAC,kBAAmC,EAAE,EAAE,CACxC,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAAC,CAC5C,KAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxE,OAAO,SAAS,EAAE,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,cAAc,EACd,cAAc,EACd,OAAO,EACR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,SAAS,GACb,CAAC,kBAAmC,EAAE,EAAE,CACxC,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAAC,CAC5C,KAAC,aAAa,IAAC,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAM,kBAAkB,YAC5E,KAAC,OAAO,cACN,KAAC,cAAc,c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S,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,CAAC;IAChD,kBAAkB,EAAE,uBAAuB,CAAC,KAAK;CAClD,CAAC,CAAC","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { fireEvent, render as rtlRender } from '@testing-library/react';\nimport type { RenderOptions, RenderResult } from '@testing-library/react';\nimport type { queries, Queries } from '@testing-library/dom';\nimport userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';\n\nimport {\n Configuration,\n LiveLog,\n ModalManager,\n PopoverManager,\n PreviewManager,\n Toaster\n} from '@pega/cosmos-react-core';\nimport type { ConfigurationProps, OmitStrict } from '@pega/cosmos-react-core';\n\nexport { default as getHighlightMocks } from '../mocks/highlightMock';\n\ntype ProvidersProps = OmitStrict<ConfigurationProps, 'children'>;\n\nconst Providers =\n (configurationProps?: ProvidersProps) =>\n ({ children }: { children: ReactElement }) => (\n <Configuration staticServerURL={window.location.origin} {...configurationProps}>\n <LiveLog>\n <PopoverManager>\n <PreviewManager>\n <Toaster>\n <ModalManager>{children}</ModalManager>\n </Toaster>\n </PreviewManager>\n </PopoverManager>\n </LiveLog>\n </Configuration>\n );\n\n// Overloads adapted from types for RTL render.\nexport function render(\n content: ReactElement,\n options?: OmitStrict<RenderOptions, 'wrapper' | 'queries'>,\n configurationProps?: ProvidersProps\n): RenderResult;\n\nexport function render<\n Q extends Queries = typeof queries,\n Container extends Element | DocumentFragment = HTMLElement,\n BaseElement extends Element | DocumentFragment = Container\n>(\n content: ReactElement,\n options: OmitStrict<RenderOptions<Q, Container, BaseElement>, 'wrapper'>,\n configurationProps?: ProvidersProps\n): RenderResult<Q, Container, BaseElement>;\n\nexport function render<\n Q extends Queries = typeof queries,\n Container extends Element | DocumentFragment = HTMLElement,\n BaseElement extends Element | DocumentFragment = Container\n>(\n content: ReactElement,\n options:\n | OmitStrict<RenderOptions, 'wrapper' | 'queries'>\n | OmitStrict<RenderOptions<Q, Container, BaseElement>, 'wrapper'> = {},\n configurationProps?: ProvidersProps\n) {\n return rtlRender(content, {\n ...options,\n wrapper: Providers(configurationProps)\n } as RenderOptions) as RenderResult | RenderResult<Q, Container, BaseElement>;\n}\n\nconst ConfigurationOnly =\n (configurationProps?: ProvidersProps) =>\n ({ children }: { children: ReactNode }) => (\n <Configuration staticServerURL={window.location.origin} {...configurationProps}>\n {children}\n </Configuration>\n );\n\n// Skips LiveLog and the managers, whose extra DOM (log regions, headings) breaks exact-DOM assertions.\nexport const renderOnlyWithConfiguration = (\n content: ReactElement,\n options?: OmitStrict<RenderOptions, 'wrapper' | 'queries'>,\n configurationProps?: ProvidersProps\n): RenderResult =>\n rtlRender(content, { ...options, wrapper: ConfigurationOnly(configurationProps) });\n\nexport const resizeWindow = (x: number, y: number) => {\n window.innerWidth = x;\n window.innerHeight = y;\n window.dispatchEvent(new Event('resize'));\n};\n\nexport const dragElement = (originEl: HTMLElement, destinationEl: HTMLElement) => {\n fireEvent.dragStart(originEl);\n fireEvent.dragEnter(destinationEl);\n fireEvent.dragOver(destinationEl);\n fireEvent.drop(destinationEl);\n};\n\nexport const userEventNoPointer = userEvent.setup({\n pointerEventsCheck: PointerEventsCheckLevel.Never\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-test-utils",
|
|
3
|
-
"version": "10.0.0-build.
|
|
3
|
+
"version": "10.0.0-build.16.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": "tsc -b tsconfig.build.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@pega/cosmos-react-core": "10.0.0-build.
|
|
20
|
+
"@pega/cosmos-react-core": "10.0.0-build.16.0",
|
|
21
21
|
"@testing-library/dom": "^10.3.0",
|
|
22
22
|
"@testing-library/react": "^16.0.0",
|
|
23
23
|
"@testing-library/user-event": "^14.6.1",
|