@pega/cosmos-react-test-utils 5.0.0-dev.9.3 → 6.0.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/SECURITY.md ADDED
@@ -0,0 +1,11 @@
1
+ # Reporting Security Issues
2
+
3
+ Pegasystems takes security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4
+
5
+ To report a security issue, [email us](mailto:opensource@pega.com;security@pega.com) and include the word "SECURITY" in the subject line.
6
+
7
+ The Pega team will send a response indicating the next steps in handling your report. We may ask for additional information or guidance.
8
+
9
+ ## Learning More About Security
10
+
11
+ To learn more about securing a Pega application or our security capabilities, please see the [security article](https://community.pega.com/knowledgebase/capabilities/security) on Pega Community and the [Pega Trust Center](https://www.pega.com/products/cloud/pega-trust-center).
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createUIDMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUIDMock.d.ts","sourceRoot":"","sources":["../../src/mocks/createUIDMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import createUID from '@pega/cosmos-react-core/lib/utils/createUID';
2
+ jest.mock('@pega/cosmos-react-core/lib/utils/createUID', () => {
3
+ const mod = jest.requireActual('@pega/cosmos-react-core/lib/utils/createUID');
4
+ return {
5
+ __esModule: true,
6
+ ...mod,
7
+ default: jest.fn(mod.default)
8
+ };
9
+ });
10
+ beforeEach(() => {
11
+ // Mock the implementation before each test, so count is reset and tests are isolated.
12
+ // We want the UID to stay somewhat unique, so we can use things like getByLabelText in tests.
13
+ let count = 0;
14
+ createUID.mockImplementation(() => {
15
+ count += 1;
16
+ return `mock-cosmos-uid-${count}`;
17
+ });
18
+ });
19
+ //# sourceMappingURL=createUIDMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUIDMock.js","sourceRoot":"","sources":["../../src/mocks/createUIDMock.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,6CAA6C,CAAC;AAEpE,IAAI,CAAC,IAAI,CAAC,6CAA6C,EAAE,GAAG,EAAE;IAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAC5B,6CAA6C,CAC9C,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,GAAG,GAAG;QACN,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC;KAC9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,EAAE;IACd,sFAAsF;IACtF,8FAA8F;IAC9F,IAAI,KAAK,GAAG,CAAC,CAAC;IACb,SAAuB,CAAC,kBAAkB,CAAC,GAAG,EAAE;QAC/C,KAAK,IAAI,CAAC,CAAC;QACX,OAAO,mBAAmB,KAAK,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import createUID from '@pega/cosmos-react-core/lib/utils/createUID';\n\njest.mock('@pega/cosmos-react-core/lib/utils/createUID', () => {\n const mod = jest.requireActual<typeof import('@pega/cosmos-react-core/lib/utils/createUID')>(\n '@pega/cosmos-react-core/lib/utils/createUID'\n );\n\n return {\n __esModule: true,\n ...mod,\n default: jest.fn(mod.default)\n };\n});\n\nbeforeEach(() => {\n // Mock the implementation before each test, so count is reset and tests are isolated.\n // We want the UID to stay somewhat unique, so we can use things like getByLabelText in tests.\n let count = 0;\n (createUID as jest.Mock).mockImplementation(() => {\n count += 1;\n return `mock-cosmos-uid-${count}`;\n });\n});\n"]}
@@ -1,10 +1,14 @@
1
1
  import './createRange';
2
+ import './createUIDMock';
2
3
  import './elementFromPointMock';
3
4
  import './iconMock';
4
5
  import './intersectionObserverMock';
5
6
  import './matchMediaMock';
6
7
  import './popoverMock';
7
8
  import './qrcodeMock';
9
+ import './svgGetBBox';
10
+ import './svgGetScreenCTM';
11
+ import './svgGetSubStringLength';
8
12
  import './resizeObserverMock';
9
13
  import './useBreakpointMock';
10
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import './createRange';
2
+ import './createUIDMock';
2
3
  import './elementFromPointMock';
3
4
  import './iconMock';
4
5
  import './intersectionObserverMock';
5
6
  import './matchMediaMock';
6
7
  import './popoverMock';
7
8
  import './qrcodeMock';
9
+ import './svgGetBBox';
10
+ import './svgGetScreenCTM';
11
+ import './svgGetSubStringLength';
8
12
  import './resizeObserverMock';
9
13
  import './useBreakpointMock';
10
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC","sourcesContent":["import './createRange';\nimport './elementFromPointMock';\nimport './iconMock';\nimport './intersectionObserverMock';\nimport './matchMediaMock';\nimport './popoverMock';\nimport './qrcodeMock';\nimport './resizeObserverMock';\nimport './useBreakpointMock';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC","sourcesContent":["import './createRange';\nimport './createUIDMock';\nimport './elementFromPointMock';\nimport './iconMock';\nimport './intersectionObserverMock';\nimport './matchMediaMock';\nimport './popoverMock';\nimport './qrcodeMock';\nimport './svgGetBBox';\nimport './svgGetScreenCTM';\nimport './svgGetSubStringLength';\nimport './resizeObserverMock';\nimport './useBreakpointMock';\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=svgGetBBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetBBox.d.ts","sourceRoot":"","sources":["../../src/mocks/svgGetBBox.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // JSDom mock for `getBBox` method on SVG graphic nodes
3
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
4
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.
5
+ window.SVGElement.prototype.getBBox = () => ({
6
+ x: 0,
7
+ y: 0,
8
+ width: 10,
9
+ height: 10,
10
+ top: 0,
11
+ bottom: 10,
12
+ left: 0,
13
+ right: 10,
14
+ toJSON() {
15
+ return this;
16
+ }
17
+ });
18
+ //# sourceMappingURL=svgGetBBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetBBox.js","sourceRoot":"","sources":["../../src/mocks/svgGetBBox.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,8EAA8E;AAE9E,4FAA4F;AAC3F,MAAM,CAAC,UAAU,CAAC,SAAgC,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC;IACnE,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,EAAE;IACT,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC","sourcesContent":["// JSDom mock for `getBBox` method on SVG graphic nodes\n// https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox\n\n// Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.\n(window.SVGElement.prototype as SVGGraphicsElement).getBBox = () => ({\n x: 0,\n y: 0,\n width: 10,\n height: 10,\n top: 0,\n bottom: 10,\n left: 0,\n right: 10,\n toJSON() {\n return this;\n }\n});\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=svgGetScreenCTM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetScreenCTM.d.ts","sourceRoot":"","sources":["../../src/mocks/svgGetScreenCTM.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // JSDom Polyfill for `getScreenCTM` method on SVG graphic nodes
3
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement
4
+ // Similar issue: https://github.com/apexcharts/react-apexcharts/issues/52#issuecomment-844757362
5
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.
6
+ window.SVGElement.prototype.getScreenCTM = () => ({
7
+ a: 0,
8
+ b: 0,
9
+ c: 0,
10
+ d: 0,
11
+ e: 0,
12
+ f: 0
13
+ });
14
+ //# sourceMappingURL=svgGetScreenCTM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetScreenCTM.js","sourceRoot":"","sources":["../../src/mocks/svgGetScreenCTM.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sEAAsE;AACtE,iGAAiG;AAEjG,4FAA4F;AAC3F,MAAM,CAAC,UAAU,CAAC,SAAgC,CAAC,YAAY,GAAG,GAAG,EAAE,CACtE,CAAC;IACC,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACS,CAAA,CAAC","sourcesContent":["// JSDom Polyfill for `getScreenCTM` method on SVG graphic nodes\n// https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement\n// Similar issue: https://github.com/apexcharts/react-apexcharts/issues/52#issuecomment-844757362\n\n// Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.\n(window.SVGElement.prototype as SVGGraphicsElement).getScreenCTM = () =>\n ({\n a: 0,\n b: 0,\n c: 0,\n d: 0,\n e: 0,\n f: 0\n } as DOMMatrix);\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=svgGetSubStringLength.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetSubStringLength.d.ts","sourceRoot":"","sources":["../../src/mocks/svgGetSubStringLength.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // JSDom Polyfill for `getSubStringLength` method on SVG text nodes
3
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
4
+ // https://webplatform.github.io/docs/svg/methods/getSubStringLength/
5
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGTextContentElement.
6
+ window.SVGElement.prototype.getSubStringLength =
7
+ // Mock: Assumes each character takes 10px width on an average and returns the substring width
8
+ (charnum, nchars) => nchars * 10;
9
+ //# sourceMappingURL=svgGetSubStringLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGetSubStringLength.js","sourceRoot":"","sources":["../../src/mocks/svgGetSubStringLength.ts"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,yEAAyE;AACzE,qEAAqE;AAErE,+FAA+F;AAC9F,MAAM,CAAC,UAAU,CAAC,SAAmC,CAAC,kBAAkB;IACvE,8FAA8F;IAC9F,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC","sourcesContent":["// JSDom Polyfill for `getSubStringLength` method on SVG text nodes\n// https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement\n// https://webplatform.github.io/docs/svg/methods/getSubStringLength/\n\n// Need to attach to SVGElement.protype because JSDOM does not implement SVGTextContentElement.\n(window.SVGElement.prototype as SVGTextContentElement).getSubStringLength =\n // Mock: Assumes each character takes 10px width on an average and returns the substring width\n (charnum, nchars) => nchars * 10;\n"]}
@@ -6,5 +6,6 @@ type ProvidersProps = OmitStrict<ConfigurationProps, 'children'>;
6
6
  export declare function render(content: ReactElement, options?: OmitStrict<RenderOptions, 'wrapper' | 'queries'>, configurationProps?: ProvidersProps): RenderResult;
7
7
  export declare function render<Q extends Queries = typeof queries, Container extends Element | DocumentFragment = HTMLElement, BaseElement extends Element | DocumentFragment = Container>(content: ReactElement, options: OmitStrict<RenderOptions<Q, Container, BaseElement>, 'wrapper'>, configurationProps?: ProvidersProps): RenderResult<Q, Container, BaseElement>;
8
8
  export declare const resizeWindow: (x: number, y: number) => void;
9
+ export declare const dragElement: (originEl: HTMLElement, destinationEl: HTMLElement) => void;
9
10
  export {};
10
11
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,KAAK,cAAc,GAAG,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAkBjE,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,EAAE,cAAc,GAClC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAmB3C,eAAO,MAAM,YAAY,MAAO,MAAM,KAAK,MAAM,SAIhD,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,KAAK,cAAc,GAAG,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAkBjE,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,EAAE,cAAc,GAClC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAmB3C,eAAO,MAAM,YAAY,MAAO,MAAM,KAAK,MAAM,SAIhD,CAAC;AAEF,eAAO,MAAM,WAAW,aAAc,WAAW,iBAAiB,WAAW,SAK5E,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render as rtlRender } from '@testing-library/react';
2
+ import { fireEvent, render as rtlRender } from '@testing-library/react';
3
3
  import { Configuration, LiveLog, ModalManager, PopoverManager, Toaster } from '@pega/cosmos-react-core';
4
4
  const Providers = (configurationProps) => ({ children }) => (_jsx(Configuration, { ...configurationProps, children: _jsx(LiveLog, { children: _jsx(PopoverManager, { children: _jsx(Toaster, { dismissAfter: 5000, children: _jsx(ModalManager, { children: children }) }) }) }) }));
5
5
  export function render(content, options = {}, configurationProps) {
@@ -13,4 +13,10 @@ export const resizeWindow = (x, y) => {
13
13
  window.innerHeight = y;
14
14
  window.dispatchEvent(new Event('resize'));
15
15
  };
16
+ export const dragElement = (originEl, destinationEl) => {
17
+ fireEvent.dragStart(originEl);
18
+ fireEvent.dragEnter(destinationEl);
19
+ fireEvent.dragOver(destinationEl);
20
+ fireEvent.drop(destinationEl);
21
+ };
16
22
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,yBAAyB,CAAC;AAKjC,MAAM,SAAS,GACb,CAAC,kBAAmC,EAAE,EAAE,CACxC,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAC3C,CACE,KAAC,aAAa,OAAK,kBAAkB,YACnC,KAAC,OAAO,cACN,KAAC,cAAc,cACb,KAAC,OAAO,IAAC,YAAY,EAAE,IAAI,YACzB,KAAC,YAAY,cAAE,QAAQ,GAAgB,GAC/B,GACK,GACT,GACI,CACjB,CAAC;AAmBN,MAAM,UAAU,MAAM,CAKpB,OAAqB,EACrB,UAEsE,EAAE,EACxE,kBAAmC;IAEnC,OAAO,SAAS,CAAC,OAAO,EAAE;QACxB,GAAG,OAAO;QACV,OAAO,EAAE,SAAS,CAAC,kBAAkB,CAAC;KACtB,CAA2D,CAAC;AAChF,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IACnD,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;IACvB,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import type { ReactElement } from 'react';\nimport { render as rtlRender } from '@testing-library/react';\nimport type { RenderOptions, RenderResult } from '@testing-library/react';\nimport type { queries, Queries } from '@testing-library/dom';\n\nimport {\n Configuration,\n LiveLog,\n ModalManager,\n PopoverManager,\n Toaster\n} from '@pega/cosmos-react-core';\nimport type { ConfigurationProps, OmitStrict } from '@pega/cosmos-react-core';\n\ntype ProvidersProps = OmitStrict<ConfigurationProps, 'children'>;\n\nconst Providers =\n (configurationProps?: ProvidersProps) =>\n ({ children }: { children: ReactElement }) =>\n (\n <Configuration {...configurationProps}>\n <LiveLog>\n <PopoverManager>\n <Toaster dismissAfter={5000}>\n <ModalManager>{children}</ModalManager>\n </Toaster>\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\nexport const resizeWindow = (x: number, y: number) => {\n window.innerWidth = x;\n window.innerHeight = y;\n window.dispatchEvent(new Event('resize'));\n};\n"]}
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;AAIxE,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,yBAAyB,CAAC;AAKjC,MAAM,SAAS,GACb,CAAC,kBAAmC,EAAE,EAAE,CACxC,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAC3C,CACE,KAAC,aAAa,OAAK,kBAAkB,YACnC,KAAC,OAAO,cACN,KAAC,cAAc,cACb,KAAC,OAAO,IAAC,YAAY,EAAE,IAAI,YACzB,KAAC,YAAY,cAAE,QAAQ,GAAgB,GAC/B,GACK,GACT,GACI,CACjB,CAAC;AAmBN,MAAM,UAAU,MAAM,CAKpB,OAAqB,EACrB,UAEsE,EAAE,EACxE,kBAAmC;IAEnC,OAAO,SAAS,CAAC,OAAO,EAAE;QACxB,GAAG,OAAO;QACV,OAAO,EAAE,SAAS,CAAC,kBAAkB,CAAC;KACtB,CAA2D,CAAC;AAChF,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IACnD,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;IACvB,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAqB,EAAE,aAA0B,EAAE,EAAE;IAC/E,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACnC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAClC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAChC,CAAC,CAAC","sourcesContent":["import type { ReactElement } 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';\n\nimport {\n Configuration,\n LiveLog,\n ModalManager,\n PopoverManager,\n Toaster\n} from '@pega/cosmos-react-core';\nimport type { ConfigurationProps, OmitStrict } from '@pega/cosmos-react-core';\n\ntype ProvidersProps = OmitStrict<ConfigurationProps, 'children'>;\n\nconst Providers =\n (configurationProps?: ProvidersProps) =>\n ({ children }: { children: ReactElement }) =>\n (\n <Configuration {...configurationProps}>\n <LiveLog>\n <PopoverManager>\n <Toaster dismissAfter={5000}>\n <ModalManager>{children}</ModalManager>\n </Toaster>\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\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-test-utils",
3
- "version": "5.0.0-dev.9.3",
3
+ "version": "6.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pegasystems/cosmos-react.git",
@@ -15,13 +15,14 @@
15
15
  "main": "lib/index.js",
16
16
  "types": "lib/index.d.ts",
17
17
  "files": [
18
- "lib"
18
+ "lib",
19
+ "SECURITY.md"
19
20
  ],
20
21
  "scripts": {
21
22
  "build": "tsc -b tsconfig.build.json"
22
23
  },
23
24
  "dependencies": {
24
- "@pega/cosmos-react-core": "5.0.0-dev.9.3",
25
+ "@pega/cosmos-react-core": "6.0.0",
25
26
  "@testing-library/dom": "^8.13.0",
26
27
  "@testing-library/react": "^12.1.3",
27
28
  "@types/jest": "^29.5.1",