@pega/cosmos-react-test-utils 8.0.0-build.9.0 → 8.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.
Files changed (55) hide show
  1. package/lib/mocks/animation.d.ts +1 -0
  2. package/lib/mocks/animation.d.ts.map +1 -0
  3. package/lib/mocks/animation.js +8 -0
  4. package/lib/mocks/animation.js.map +1 -0
  5. package/lib/mocks/broadcastChannelMock.d.ts +1 -0
  6. package/lib/mocks/broadcastChannelMock.d.ts.map +1 -0
  7. package/lib/mocks/broadcastChannelMock.js +12 -0
  8. package/lib/mocks/broadcastChannelMock.js.map +1 -0
  9. package/lib/mocks/createRange.js +12 -10
  10. package/lib/mocks/createRange.js.map +1 -1
  11. package/lib/mocks/elementFromPointMock.js +3 -1
  12. package/lib/mocks/elementFromPointMock.js.map +1 -1
  13. package/lib/mocks/getCurrentPositionMock.d.ts +0 -1
  14. package/lib/mocks/getCurrentPositionMock.d.ts.map +1 -1
  15. package/lib/mocks/getCurrentPositionMock.js +22 -20
  16. package/lib/mocks/getCurrentPositionMock.js.map +1 -1
  17. package/lib/mocks/index.d.ts +5 -0
  18. package/lib/mocks/index.d.ts.map +1 -1
  19. package/lib/mocks/index.js +5 -0
  20. package/lib/mocks/index.js.map +1 -1
  21. package/lib/mocks/innerTextMock.d.ts +1 -0
  22. package/lib/mocks/innerTextMock.d.ts.map +1 -0
  23. package/lib/mocks/innerTextMock.js +13 -0
  24. package/lib/mocks/innerTextMock.js.map +1 -0
  25. package/lib/mocks/intersectionObserverMock.js +11 -9
  26. package/lib/mocks/intersectionObserverMock.js.map +1 -1
  27. package/lib/mocks/localStorageMock.d.ts +1 -0
  28. package/lib/mocks/localStorageMock.d.ts.map +1 -0
  29. package/lib/mocks/localStorageMock.js +10 -0
  30. package/lib/mocks/localStorageMock.js.map +1 -0
  31. package/lib/mocks/matchMediaMock.js +12 -10
  32. package/lib/mocks/matchMediaMock.js.map +1 -1
  33. package/lib/mocks/mutationObserverMock.js +9 -7
  34. package/lib/mocks/mutationObserverMock.js.map +1 -1
  35. package/lib/mocks/randomUUID.js +3 -1
  36. package/lib/mocks/randomUUID.js.map +1 -1
  37. package/lib/mocks/resizeObserverMock.js +7 -5
  38. package/lib/mocks/resizeObserverMock.js.map +1 -1
  39. package/lib/mocks/scrollIntoView.js +3 -1
  40. package/lib/mocks/scrollIntoView.js.map +1 -1
  41. package/lib/mocks/svgGetBBox.js +18 -16
  42. package/lib/mocks/svgGetBBox.js.map +1 -1
  43. package/lib/mocks/svgGetScreenCTM.js +14 -12
  44. package/lib/mocks/svgGetScreenCTM.js.map +1 -1
  45. package/lib/mocks/svgGetSubStringLength.js +9 -7
  46. package/lib/mocks/svgGetSubStringLength.js.map +1 -1
  47. package/lib/mocks/urlCanParse.d.ts +1 -0
  48. package/lib/mocks/urlCanParse.d.ts.map +1 -0
  49. package/lib/mocks/urlCanParse.js +14 -0
  50. package/lib/mocks/urlCanParse.js.map +1 -0
  51. package/lib/utils/utils.d.ts +1 -0
  52. package/lib/utils/utils.d.ts.map +1 -1
  53. package/lib/utils/utils.js +4 -0
  54. package/lib/utils/utils.js.map +1 -1
  55. package/package.json +9 -8
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/mocks/animation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ if (typeof window !== 'undefined') {
3
+ window.Element.prototype.animate = () => ({
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ addEventListener: (type, listener) => { }
6
+ });
7
+ }
8
+ //# sourceMappingURL=animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/mocks/animation.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE,CACtC,CAAC;QACC,6DAA6D;QAC7D,gBAAgB,EAAE,CAAC,IAAY,EAAE,QAA4C,EAAE,EAAE,GAAE,CAAC;KACrF,CAAc,CAAC;AACpB,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.Element.prototype.animate = () =>\n ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n addEventListener: (type: string, listener: EventListenerOrEventListenerObject) => {}\n }) as Animation;\n}\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=broadcastChannelMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcastChannelMock.d.ts","sourceRoot":"","sources":["../../src/mocks/broadcastChannelMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ globalThis.BroadcastChannel = class BroadcastChannel {
3
+ // eslint-disable-next-line class-methods-use-this
4
+ onMessage() { }
5
+ postMessage(data) {
6
+ // @ts-expect-error
7
+ this.onmessage?.({ data });
8
+ }
9
+ // eslint-disable-next-line class-methods-use-this
10
+ close() { }
11
+ };
12
+ //# sourceMappingURL=broadcastChannelMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcastChannelMock.js","sourceRoot":"","sources":["../../src/mocks/broadcastChannelMock.ts"],"names":[],"mappings":";AAAA,UAAU,CAAC,gBAAgB,GAAG,MAAM,gBAAgB;IAClD,kDAAkD;IAClD,SAAS,KAAI,CAAC;IAEd,WAAW,CAAC,IAAa;QACvB,mBAAmB;QACnB,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,kDAAkD;IAClD,KAAK,KAAI,CAAC;CAC2B,CAAC","sourcesContent":["globalThis.BroadcastChannel = class BroadcastChannel {\n // eslint-disable-next-line class-methods-use-this\n onMessage() {}\n\n postMessage(data: unknown) {\n // @ts-expect-error\n this.onmessage?.({ data });\n }\n\n // eslint-disable-next-line class-methods-use-this\n close() {}\n} as unknown as typeof BroadcastChannel;\n"]}
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
- document.createRange = () => {
3
- const range = new Range();
4
- range.getBoundingClientRect = jest.fn();
5
- range.getClientRects = () => {
6
- return {
7
- item: () => null,
8
- length: 0,
9
- [Symbol.iterator]: jest.fn()
2
+ if (typeof document !== 'undefined') {
3
+ document.createRange = () => {
4
+ const range = new Range();
5
+ range.getBoundingClientRect = jest.fn();
6
+ range.getClientRects = () => {
7
+ return {
8
+ item: () => null,
9
+ length: 0,
10
+ [Symbol.iterator]: jest.fn()
11
+ };
10
12
  };
13
+ return range;
11
14
  };
12
- return range;
13
- };
15
+ }
14
16
  //# sourceMappingURL=createRange.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRange.js","sourceRoot":"","sources":["../../src/mocks/createRange.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,WAAW,GAAG,GAAG,EAAE;IAC1B,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;IAE1B,KAAK,CAAC,qBAAqB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAExC,KAAK,CAAC,cAAc,GAAG,GAAG,EAAE;QAC1B,OAAO;YACL,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;YAChB,MAAM,EAAE,CAAC;YACT,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;SAC7B,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["document.createRange = () => {\n const range = new Range();\n\n range.getBoundingClientRect = jest.fn();\n\n range.getClientRects = () => {\n return {\n item: () => null,\n length: 0,\n [Symbol.iterator]: jest.fn()\n };\n };\n\n return range;\n};\n"]}
1
+ {"version":3,"file":"createRange.js","sourceRoot":"","sources":["../../src/mocks/createRange.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,GAAG,GAAG,EAAE;QAC1B,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAE1B,KAAK,CAAC,qBAAqB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAExC,KAAK,CAAC,cAAc,GAAG,GAAG,EAAE;YAC1B,OAAO;gBACL,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;gBAChB,MAAM,EAAE,CAAC;gBACT,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;aAC7B,CAAC;QACJ,CAAC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC","sourcesContent":["if (typeof document !== 'undefined') {\n document.createRange = () => {\n const range = new Range();\n\n range.getBoundingClientRect = jest.fn();\n\n range.getClientRects = () => {\n return {\n item: () => null,\n length: 0,\n [Symbol.iterator]: jest.fn()\n };\n };\n\n return range;\n };\n}\n"]}
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
- document.elementFromPoint = jest.fn(() => null);
2
+ if (typeof document !== 'undefined') {
3
+ document.elementFromPoint = jest.fn(() => null);
4
+ }
3
5
  //# sourceMappingURL=elementFromPointMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementFromPointMock.js","sourceRoot":"","sources":["../../src/mocks/elementFromPointMock.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC","sourcesContent":["document.elementFromPoint = jest.fn(() => null);\n"]}
1
+ {"version":3,"file":"elementFromPointMock.js","sourceRoot":"","sources":["../../src/mocks/elementFromPointMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC","sourcesContent":["if (typeof document !== 'undefined') {\n document.elementFromPoint = jest.fn(() => null);\n}\n"]}
@@ -1,2 +1 @@
1
- declare const getCurrentPositionMock: Geolocation['getCurrentPosition'];
2
1
  //# sourceMappingURL=getCurrentPositionMock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCurrentPositionMock.d.ts","sourceRoot":"","sources":["../../src/mocks/getCurrentPositionMock.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,sBAAsB,EAAE,WAAW,CAAC,oBAAoB,CAa7D,CAAC"}
1
+ {"version":3,"file":"getCurrentPositionMock.d.ts","sourceRoot":"","sources":["../../src/mocks/getCurrentPositionMock.ts"],"names":[],"mappings":""}
@@ -1,24 +1,26 @@
1
1
  "use strict";
2
- const getCurrentPositionMock = successCallback => {
3
- successCallback({
4
- coords: {
5
- latitude: 0,
6
- longitude: 0,
7
- accuracy: 1,
8
- heading: null,
9
- altitude: null,
10
- altitudeAccuracy: null,
11
- speed: null
2
+ if (typeof navigator !== 'undefined') {
3
+ const getCurrentPositionMock = successCallback => {
4
+ successCallback({
5
+ coords: {
6
+ latitude: 0,
7
+ longitude: 0,
8
+ accuracy: 1,
9
+ heading: null,
10
+ altitude: null,
11
+ altitudeAccuracy: null,
12
+ speed: null
13
+ },
14
+ timestamp: Date.now()
15
+ });
16
+ };
17
+ Object.defineProperty(navigator, 'geolocation', {
18
+ value: {
19
+ getCurrentPosition: getCurrentPositionMock,
20
+ watchPosition: () => { },
21
+ clearWatch: () => { }
12
22
  },
13
- timestamp: Date.now()
23
+ configurable: true
14
24
  });
15
- };
16
- Object.defineProperty(globalThis.navigator, 'geolocation', {
17
- value: {
18
- getCurrentPosition: getCurrentPositionMock,
19
- watchPosition: () => { },
20
- clearWatch: () => { }
21
- },
22
- configurable: true
23
- });
25
+ }
24
26
  //# sourceMappingURL=getCurrentPositionMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCurrentPositionMock.js","sourceRoot":"","sources":["../../src/mocks/getCurrentPositionMock.ts"],"names":[],"mappings":";AAAA,MAAM,sBAAsB,GAAsC,eAAe,CAAC,EAAE;IAClF,eAAe,CAAC;QACd,MAAM,EAAE;YACN,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,gBAAgB,EAAE,IAAI;YACtB,KAAK,EAAE,IAAI;SACZ;QACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,EAAE;IACzD,KAAK,EAAE;QACL,kBAAkB,EAAE,sBAAsB;QAC1C,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;QACvB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;KACrB;IACD,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC","sourcesContent":["const getCurrentPositionMock: Geolocation['getCurrentPosition'] = successCallback => {\n successCallback({\n coords: {\n latitude: 0,\n longitude: 0,\n accuracy: 1,\n heading: null,\n altitude: null,\n altitudeAccuracy: null,\n speed: null\n },\n timestamp: Date.now()\n });\n};\n\nObject.defineProperty(globalThis.navigator, 'geolocation', {\n value: {\n getCurrentPosition: getCurrentPositionMock,\n watchPosition: () => {},\n clearWatch: () => {}\n },\n configurable: true\n});\n"]}
1
+ {"version":3,"file":"getCurrentPositionMock.js","sourceRoot":"","sources":["../../src/mocks/getCurrentPositionMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;IACrC,MAAM,sBAAsB,GAAsC,eAAe,CAAC,EAAE;QAClF,eAAe,CAAC;YACd,MAAM,EAAE;gBACN,QAAQ,EAAE,CAAC;gBACX,SAAS,EAAE,CAAC;gBACZ,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,gBAAgB,EAAE,IAAI;gBACtB,KAAK,EAAE,IAAI;aACZ;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,aAAa,EAAE;QAC9C,KAAK,EAAE;YACL,kBAAkB,EAAE,sBAAsB;YAC1C,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;YACvB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;SACrB;QACD,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["if (typeof navigator !== 'undefined') {\n const getCurrentPositionMock: Geolocation['getCurrentPosition'] = successCallback => {\n successCallback({\n coords: {\n latitude: 0,\n longitude: 0,\n accuracy: 1,\n heading: null,\n altitude: null,\n altitudeAccuracy: null,\n speed: null\n },\n timestamp: Date.now()\n });\n };\n\n Object.defineProperty(navigator, 'geolocation', {\n value: {\n getCurrentPosition: getCurrentPositionMock,\n watchPosition: () => {},\n clearWatch: () => {}\n },\n configurable: true\n });\n}\n"]}
@@ -1,10 +1,14 @@
1
+ import './animation';
2
+ import './broadcastChannelMock';
1
3
  import './createObjectURL';
2
4
  import './createRange';
3
5
  import './createUIDMock';
4
6
  import './elementFromPointMock';
5
7
  import './getCurrentPositionMock';
6
8
  import './iconMock';
9
+ import './innerTextMock';
7
10
  import './intersectionObserverMock';
11
+ import './localStorageMock';
8
12
  import './mapsAPILoaderMock';
9
13
  import './matchMediaMock';
10
14
  import './popoverMock';
@@ -15,5 +19,6 @@ import './svgGetBBox';
15
19
  import './svgGetScreenCTM';
16
20
  import './svgGetSubStringLength';
17
21
  import './resizeObserverMock';
22
+ import './urlCanParse';
18
23
  import './useBreakpointMock';
19
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,wBAAwB,CAAC;AAChC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AACzB,OAAO,4BAA4B,CAAC;AACpC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC"}
@@ -1,10 +1,14 @@
1
+ import './animation';
2
+ import './broadcastChannelMock';
1
3
  import './createObjectURL';
2
4
  import './createRange';
3
5
  import './createUIDMock';
4
6
  import './elementFromPointMock';
5
7
  import './getCurrentPositionMock';
6
8
  import './iconMock';
9
+ import './innerTextMock';
7
10
  import './intersectionObserverMock';
11
+ import './localStorageMock';
8
12
  import './mapsAPILoaderMock';
9
13
  import './matchMediaMock';
10
14
  import './popoverMock';
@@ -15,5 +19,6 @@ import './svgGetBBox';
15
19
  import './svgGetScreenCTM';
16
20
  import './svgGetSubStringLength';
17
21
  import './resizeObserverMock';
22
+ import './urlCanParse';
18
23
  import './useBreakpointMock';
19
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC","sourcesContent":["import './createObjectURL';\nimport './createRange';\nimport './createUIDMock';\nimport './elementFromPointMock';\nimport './getCurrentPositionMock';\nimport './iconMock';\nimport './intersectionObserverMock';\nimport './mapsAPILoaderMock';\nimport './matchMediaMock';\nimport './popoverMock';\nimport './qrcodeMock';\nimport './randomUUID';\nimport './scrollIntoView';\nimport './svgGetBBox';\nimport './svgGetScreenCTM';\nimport './svgGetSubStringLength';\nimport './resizeObserverMock';\nimport './useBreakpointMock';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,wBAAwB,CAAC;AAChC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AACzB,OAAO,4BAA4B,CAAC;AACpC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC","sourcesContent":["import './animation';\nimport './broadcastChannelMock';\nimport './createObjectURL';\nimport './createRange';\nimport './createUIDMock';\nimport './elementFromPointMock';\nimport './getCurrentPositionMock';\nimport './iconMock';\nimport './innerTextMock';\nimport './intersectionObserverMock';\nimport './localStorageMock';\nimport './mapsAPILoaderMock';\nimport './matchMediaMock';\nimport './popoverMock';\nimport './qrcodeMock';\nimport './randomUUID';\nimport './scrollIntoView';\nimport './svgGetBBox';\nimport './svgGetScreenCTM';\nimport './svgGetSubStringLength';\nimport './resizeObserverMock';\nimport './urlCanParse';\nimport './useBreakpointMock';\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=innerTextMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innerTextMock.d.ts","sourceRoot":"","sources":["../../src/mocks/innerTextMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ if (typeof window !== 'undefined') {
3
+ // innerText is not supported by JSDOM, mock it to use textContent instead.
4
+ Object.defineProperty(window.HTMLElement.prototype, 'innerText', {
5
+ get() {
6
+ return this.textContent;
7
+ },
8
+ set(value) {
9
+ this.textContent = value;
10
+ }
11
+ });
12
+ }
13
+ //# sourceMappingURL=innerTextMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innerTextMock.js","sourceRoot":"","sources":["../../src/mocks/innerTextMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,2EAA2E;IAC3E,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE;QAC/D,GAAG;YACD,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QACD,GAAG,CAAC,KAAK;YACP,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3B,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n // innerText is not supported by JSDOM, mock it to use textContent instead.\n Object.defineProperty(window.HTMLElement.prototype, 'innerText', {\n get() {\n return this.textContent;\n },\n set(value) {\n this.textContent = value;\n }\n });\n}\n"]}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
- window.IntersectionObserver = jest.fn(() => ({
3
- root: null,
4
- rootMargin: '0',
5
- thresholds: [],
6
- takeRecords: () => [],
7
- observe: () => { },
8
- unobserve: () => { },
9
- disconnect: () => { }
10
- }));
2
+ if (typeof window !== 'undefined') {
3
+ window.IntersectionObserver = jest.fn(() => ({
4
+ root: null,
5
+ rootMargin: '0',
6
+ thresholds: [],
7
+ takeRecords: () => [],
8
+ observe: () => { },
9
+ unobserve: () => { },
10
+ disconnect: () => { }
11
+ }));
12
+ }
11
13
  //# sourceMappingURL=intersectionObserverMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intersectionObserverMock.js","sourceRoot":"","sources":["../../src/mocks/intersectionObserverMock.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;IACrB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;IACnB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;CACrB,CAAC,CAAC,CAAC","sourcesContent":["window.IntersectionObserver = jest.fn(() => ({\n root: null,\n rootMargin: '0',\n thresholds: [],\n takeRecords: () => [],\n observe: () => {},\n unobserve: () => {},\n disconnect: () => {}\n}));\n"]}
1
+ {"version":3,"file":"intersectionObserverMock.js","sourceRoot":"","sources":["../../src/mocks/intersectionObserverMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3C,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;QACrB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;KACrB,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.IntersectionObserver = jest.fn(() => ({\n root: null,\n rootMargin: '0',\n thresholds: [],\n takeRecords: () => [],\n observe: () => {},\n unobserve: () => {},\n disconnect: () => {}\n }));\n}\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=localStorageMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localStorageMock.d.ts","sourceRoot":"","sources":["../../src/mocks/localStorageMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ globalThis.localStorage = {
3
+ getItem: () => null,
4
+ setItem: () => { },
5
+ removeItem: () => { },
6
+ clear: () => { },
7
+ key: () => null,
8
+ length: 0
9
+ };
10
+ //# sourceMappingURL=localStorageMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localStorageMock.js","sourceRoot":"","sources":["../../src/mocks/localStorageMock.ts"],"names":[],"mappings":";AAAA,UAAU,CAAC,YAAY,GAAG;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;IACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;IACf,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;IACf,MAAM,EAAE,CAAC;CACV,CAAC","sourcesContent":["globalThis.localStorage = {\n getItem: () => null,\n setItem: () => {},\n removeItem: () => {},\n clear: () => {},\n key: () => null,\n length: 0\n};\n"]}
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
- window.matchMedia = jest.fn((query) => ({
3
- matches: false,
4
- media: query,
5
- onchange: null,
6
- addListener: () => { },
7
- removeListener: () => { },
8
- addEventListener: () => { },
9
- removeEventListener: () => { },
10
- dispatchEvent: () => false
11
- }));
2
+ if (typeof window !== 'undefined') {
3
+ window.matchMedia = jest.fn((query) => ({
4
+ matches: false,
5
+ media: query,
6
+ onchange: null,
7
+ addListener: () => { },
8
+ removeListener: () => { },
9
+ addEventListener: () => { },
10
+ removeEventListener: () => { },
11
+ dispatchEvent: () => false
12
+ }));
13
+ }
12
14
  //# sourceMappingURL=matchMediaMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchMediaMock.js","sourceRoot":"","sources":["../../src/mocks/matchMediaMock.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC7B,aAAa,EAAE,GAAG,EAAE,CAAC,KAAK;CAC3B,CAAC,CAAC,CAAC","sourcesContent":["window.matchMedia = jest.fn((query: string) => ({\n matches: false,\n media: query,\n onchange: null,\n addListener: () => {},\n removeListener: () => {},\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false\n}));\n"]}
1
+ {"version":3,"file":"matchMediaMock.js","sourceRoot":"","sources":["../../src/mocks/matchMediaMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;QACrB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;QACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;QAC1B,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;QAC7B,aAAa,EAAE,GAAG,EAAE,CAAC,KAAK;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.matchMedia = jest.fn((query: string) => ({\n matches: false,\n media: query,\n onchange: null,\n addListener: () => {},\n removeListener: () => {},\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false\n }));\n}\n"]}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
- window.MutationObserver = jest.fn(() => {
3
- return {
4
- observe: jest.fn(),
5
- disconnect: jest.fn(),
6
- takeRecords: jest.fn()
7
- };
8
- });
2
+ if (typeof window !== 'undefined') {
3
+ window.MutationObserver = jest.fn(() => {
4
+ return {
5
+ observe: jest.fn(),
6
+ disconnect: jest.fn(),
7
+ takeRecords: jest.fn()
8
+ };
9
+ });
10
+ }
9
11
  //# sourceMappingURL=mutationObserverMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutationObserverMock.js","sourceRoot":"","sources":["../../src/mocks/mutationObserverMock.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;IACrC,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;QAClB,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;KACvB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["window.MutationObserver = jest.fn(() => {\n return {\n observe: jest.fn(),\n disconnect: jest.fn(),\n takeRecords: jest.fn()\n };\n});\n"]}
1
+ {"version":3,"file":"mutationObserverMock.js","sourceRoot":"","sources":["../../src/mocks/mutationObserverMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;QACrC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAClB,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;YACrB,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.MutationObserver = jest.fn(() => {\n return {\n observe: jest.fn(),\n disconnect: jest.fn(),\n takeRecords: jest.fn()\n };\n });\n}\n"]}
@@ -1,3 +1,5 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- window.crypto.randomUUID = () => randomUUID();
2
+ if (typeof window !== 'undefined') {
3
+ window.crypto.randomUUID = () => randomUUID();
4
+ }
3
5
  //# sourceMappingURL=randomUUID.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"randomUUID.js","sourceRoot":"","sources":["../../src/mocks/randomUUID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC","sourcesContent":["import { randomUUID } from 'node:crypto';\n\nwindow.crypto.randomUUID = () => randomUUID();\n"]}
1
+ {"version":3,"file":"randomUUID.js","sourceRoot":"","sources":["../../src/mocks/randomUUID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { randomUUID } from 'node:crypto';\n\nif (typeof window !== 'undefined') {\n window.crypto.randomUUID = () => randomUUID();\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
- window.ResizeObserver = jest.fn(() => ({
3
- observe: () => { },
4
- unobserve: () => { },
5
- disconnect: () => { }
6
- }));
2
+ if (typeof window !== 'undefined') {
3
+ window.ResizeObserver = jest.fn(() => ({
4
+ observe: () => { },
5
+ unobserve: () => { },
6
+ disconnect: () => { }
7
+ }));
8
+ }
7
9
  //# sourceMappingURL=resizeObserverMock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizeObserverMock.js","sourceRoot":"","sources":["../../src/mocks/resizeObserverMock.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;IACnB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;CACrB,CAAC,CAAC,CAAC","sourcesContent":["window.ResizeObserver = jest.fn(() => ({\n observe: () => {},\n unobserve: () => {},\n disconnect: () => {}\n}));\n"]}
1
+ {"version":3,"file":"resizeObserverMock.js","sourceRoot":"","sources":["../../src/mocks/resizeObserverMock.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QACrC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;KACrB,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.ResizeObserver = jest.fn(() => ({\n observe: () => {},\n unobserve: () => {},\n disconnect: () => {}\n }));\n}\n"]}
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
- window.Element.prototype.scrollIntoView = () => { };
2
+ if (typeof window !== 'undefined') {
3
+ window.Element.prototype.scrollIntoView = () => { };
4
+ }
3
5
  //# sourceMappingURL=scrollIntoView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollIntoView.js","sourceRoot":"","sources":["../../src/mocks/scrollIntoView.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC","sourcesContent":["window.Element.prototype.scrollIntoView = () => {};\n"]}
1
+ {"version":3,"file":"scrollIntoView.js","sourceRoot":"","sources":["../../src/mocks/scrollIntoView.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n window.Element.prototype.scrollIntoView = () => {};\n}\n"]}
@@ -1,18 +1,20 @@
1
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
- });
2
+ if (typeof window !== 'undefined') {
3
+ // JSDom mock for `getBBox` method on SVG graphic nodes
4
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
5
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.
6
+ window.SVGElement.prototype.getBBox = () => ({
7
+ x: 0,
8
+ y: 0,
9
+ width: 10,
10
+ height: 10,
11
+ top: 0,
12
+ bottom: 10,
13
+ left: 0,
14
+ right: 10,
15
+ toJSON() {
16
+ return this;
17
+ }
18
+ });
19
+ }
18
20
  //# sourceMappingURL=svgGetBBox.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"svgGetBBox.js","sourceRoot":"","sources":["../../src/mocks/svgGetBBox.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,uDAAuD;IACvD,8EAA8E;IAE9E,4FAA4F;IAC3F,MAAM,CAAC,UAAU,CAAC,SAAgC,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC;QACnE,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,EAAE;QACT,MAAM;YACJ,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n // 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}\n"]}
@@ -1,14 +1,16 @@
1
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
- });
2
+ if (typeof window !== 'undefined') {
3
+ // JSDom Polyfill for `getScreenCTM` method on SVG graphic nodes
4
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement
5
+ // Similar issue: https://github.com/apexcharts/react-apexcharts/issues/52#issuecomment-844757362
6
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGGraphicsElement.
7
+ window.SVGElement.prototype.getScreenCTM = () => ({
8
+ a: 0,
9
+ b: 0,
10
+ c: 0,
11
+ d: 0,
12
+ e: 0,
13
+ f: 0
14
+ });
15
+ }
14
16
  //# sourceMappingURL=svgGetScreenCTM.js.map
@@ -1 +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;CACL,CAAc,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"]}
1
+ {"version":3,"file":"svgGetScreenCTM.js","sourceRoot":"","sources":["../../src/mocks/svgGetScreenCTM.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,gEAAgE;IAChE,sEAAsE;IACtE,iGAAiG;IAEjG,4FAA4F;IAC3F,MAAM,CAAC,UAAU,CAAC,SAAgC,CAAC,YAAY,GAAG,GAAG,EAAE,CACtE,CAAC;QACC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAc,CAAC;AACpB,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n // 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}\n"]}
@@ -1,9 +1,11 @@
1
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;
2
+ if (typeof window !== 'undefined') {
3
+ // JSDom Polyfill for `getSubStringLength` method on SVG text nodes
4
+ // https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
5
+ // https://webplatform.github.io/docs/svg/methods/getSubStringLength/
6
+ // Need to attach to SVGElement.protype because JSDOM does not implement SVGTextContentElement.
7
+ window.SVGElement.prototype.getSubStringLength =
8
+ // Mock: Assumes each character takes 10px width on an average and returns the substring width
9
+ (charnum, nchars) => nchars * 10;
10
+ }
9
11
  //# sourceMappingURL=svgGetSubStringLength.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"svgGetSubStringLength.js","sourceRoot":"","sources":["../../src/mocks/svgGetSubStringLength.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,mEAAmE;IACnE,yEAAyE;IACzE,qEAAqE;IAErE,+FAA+F;IAC9F,MAAM,CAAC,UAAU,CAAC,SAAmC,CAAC,kBAAkB;QACvE,8FAA8F;QAC9F,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC;AACrC,CAAC","sourcesContent":["if (typeof window !== 'undefined') {\n // 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}\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=urlCanParse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlCanParse.d.ts","sourceRoot":"","sources":["../../src/mocks/urlCanParse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ if (typeof URL.canParse !== 'function') {
3
+ URL.canParse = (url, base) => {
4
+ try {
5
+ // eslint-disable-next-line no-new
6
+ new URL(url, base);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ };
13
+ }
14
+ //# sourceMappingURL=urlCanParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlCanParse.js","sourceRoot":"","sources":["../../src/mocks/urlCanParse.ts"],"names":[],"mappings":";AAAA,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;IACvC,GAAG,CAAC,QAAQ,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,IAAI,CAAC;YACH,kCAAkC;YAClC,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["if (typeof URL.canParse !== 'function') {\n URL.canParse = (url, base) => {\n try {\n // eslint-disable-next-line no-new\n new URL(url, base);\n return true;\n } catch {\n return false;\n }\n };\n}\n"]}
@@ -7,5 +7,6 @@ export declare function render(content: ReactElement, options?: OmitStrict<Rende
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
9
  export declare const dragElement: (originEl: HTMLElement, destinationEl: HTMLElement) => void;
10
+ export declare const userEventNoPointer: import("@testing-library/user-event").UserEvent;
10
11
  export {};
11
12
  //# 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;AAiBjE,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
+ {"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;AAU7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,KAAK,cAAc,GAAG,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAiBjE,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;AAEF,eAAO,MAAM,kBAAkB,iDAE7B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { fireEvent, render as rtlRender } from '@testing-library/react';
3
+ import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
3
4
  import { Configuration, LiveLog, ModalManager, PopoverManager, Toaster } from '@pega/cosmos-react-core';
4
5
  const Providers = (configurationProps) => ({ children }) => (_jsx(Configuration, { ...configurationProps, children: _jsx(LiveLog, { children: _jsx(PopoverManager, { children: _jsx(Toaster, { dismissAfter: 5000, children: _jsx(ModalManager, { children: children }) }) }) }) }));
5
6
  export function render(content, options = {}, configurationProps) {
@@ -19,4 +20,7 @@ export const dragElement = (originEl, destinationEl) => {
19
20
  fireEvent.dragOver(destinationEl);
20
21
  fireEvent.drop(destinationEl);
21
22
  };
23
+ export const userEventNoPointer = userEvent.setup({
24
+ pointerEventsCheck: PointerEventsCheckLevel.Never
25
+ });
22
26
  //# sourceMappingURL=utils.js.map
@@ -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;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,CAAC,CAC5C,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;AAmBJ,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 <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"]}
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,OAAO,EACR,MAAM,yBAAyB,CAAC;AAKjC,MAAM,SAAS,GACb,CAAC,kBAAmC,EAAE,EAAE,CACxC,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAAC,CAC5C,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;AAmBJ,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;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,CAAC;IAChD,kBAAkB,EAAE,uBAAuB,CAAC,KAAK;CAClD,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';\nimport userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';\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 <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\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": "8.0.0-build.9.0",
3
+ "version": "8.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pegasystems/cosmos-react.git",
@@ -22,17 +22,18 @@
22
22
  "build": "tsc -b tsconfig.build.json"
23
23
  },
24
24
  "dependencies": {
25
- "@pega/cosmos-react-core": "8.0.0-build.9.0",
26
- "@testing-library/dom": "^8.13.0",
27
- "@testing-library/react": "^12.1.3",
25
+ "@pega/cosmos-react-core": "8.0.0",
26
+ "@testing-library/dom": "^10.3.0",
27
+ "@testing-library/react": "^16.0.0",
28
+ "@testing-library/user-event": "^14.6.1",
28
29
  "@types/jest": "^29.5.1",
29
- "@types/react": "^17.0.62",
30
- "@types/react-dom": "^17.0.20",
30
+ "@types/react": "^17.0.62 || ^18.3.3",
31
+ "@types/react-dom": "^17.0.20 || ^18.3.0",
31
32
  "chalk": "^2.4.2",
32
33
  "jest-styled-components": "^7.1.1",
33
34
  "polished": "^4.1.0",
34
- "react": "^17.0.0",
35
- "react-dom": "^17.0.0"
35
+ "react": "^17.0.0 || ^18.0.0",
36
+ "react-dom": "^17.0.0 || ^18.0.0"
36
37
  },
37
38
  "devDependencies": {
38
39
  "typescript": "~5.5.4"