@pega/cosmos-react-test-utils 4.0.0-dev.9.1 → 4.0.0-rc.1

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 (45) hide show
  1. package/lib/mocks/createRange.d.ts +1 -0
  2. package/lib/mocks/createRange.d.ts.map +1 -0
  3. package/lib/mocks/createRange.js +14 -0
  4. package/lib/mocks/createRange.js.map +1 -0
  5. package/lib/mocks/elementFromPointMock.d.ts +1 -0
  6. package/lib/mocks/elementFromPointMock.d.ts.map +1 -0
  7. package/lib/mocks/elementFromPointMock.js +3 -0
  8. package/lib/mocks/elementFromPointMock.js.map +1 -0
  9. package/lib/mocks/iconMock.d.ts +2 -0
  10. package/lib/mocks/iconMock.d.ts.map +1 -0
  11. package/lib/mocks/iconMock.js +20 -0
  12. package/lib/mocks/iconMock.js.map +1 -0
  13. package/lib/mocks/index.d.ts +10 -0
  14. package/lib/mocks/index.d.ts.map +1 -0
  15. package/lib/mocks/index.js +10 -0
  16. package/lib/mocks/index.js.map +1 -0
  17. package/lib/mocks/intersectionObserverMock.d.ts +1 -0
  18. package/lib/mocks/intersectionObserverMock.d.ts.map +1 -0
  19. package/lib/mocks/intersectionObserverMock.js +11 -0
  20. package/lib/mocks/intersectionObserverMock.js.map +1 -0
  21. package/lib/mocks/matchMediaMock.d.ts +1 -0
  22. package/lib/mocks/matchMediaMock.d.ts.map +1 -0
  23. package/lib/mocks/matchMediaMock.js +12 -0
  24. package/lib/mocks/matchMediaMock.js.map +1 -0
  25. package/lib/mocks/mutationObserverMock.d.ts +1 -0
  26. package/lib/mocks/mutationObserverMock.d.ts.map +1 -0
  27. package/lib/mocks/mutationObserverMock.js +9 -0
  28. package/lib/mocks/mutationObserverMock.js.map +1 -0
  29. package/lib/mocks/popoverMock.d.ts +2 -0
  30. package/lib/mocks/popoverMock.d.ts.map +1 -0
  31. package/lib/mocks/popoverMock.js +15 -0
  32. package/lib/mocks/popoverMock.js.map +1 -0
  33. package/lib/mocks/qrcodeMock.d.ts +1 -0
  34. package/lib/mocks/qrcodeMock.d.ts.map +1 -0
  35. package/lib/mocks/qrcodeMock.js +5 -0
  36. package/lib/mocks/qrcodeMock.js.map +1 -0
  37. package/lib/mocks/resizeObserverMock.d.ts +1 -0
  38. package/lib/mocks/resizeObserverMock.d.ts.map +1 -0
  39. package/lib/mocks/resizeObserverMock.js +7 -0
  40. package/lib/mocks/resizeObserverMock.js.map +1 -0
  41. package/lib/mocks/useBreakpointMock.d.ts +1 -0
  42. package/lib/mocks/useBreakpointMock.d.ts.map +1 -0
  43. package/lib/mocks/useBreakpointMock.js +12 -0
  44. package/lib/mocks/useBreakpointMock.js.map +1 -0
  45. package/package.json +10 -10
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=createRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRange.d.ts","sourceRoot":"","sources":["../../src/mocks/createRange.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
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()
10
+ };
11
+ };
12
+ return range;
13
+ };
14
+ //# sourceMappingURL=createRange.js.map
@@ -0,0 +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"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=elementFromPointMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementFromPointMock.d.ts","sourceRoot":"","sources":["../../src/mocks/elementFromPointMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ document.elementFromPoint = jest.fn(() => null);
3
+ //# sourceMappingURL=elementFromPointMock.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=iconMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconMock.d.ts","sourceRoot":"","sources":["../../src/mocks/iconMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ jest.mock('@pega/cosmos-react-core/lib/components/Icon/Icon', () => {
2
+ // Should probably be using global require here in case createElement or forwardRef are themselves being mocked,
3
+ // but that requires including @types/node which throws off type checking for tests.
4
+ const { createElement, forwardRef } = jest.requireActual('react');
5
+ const mod = jest.requireActual('@pega/cosmos-react-core/lib/components/Icon/Icon');
6
+ return {
7
+ __esModule: true,
8
+ ...mod,
9
+ default: forwardRef(function IconMock({ name, ...restProps }, ref) {
10
+ return createElement(mod.StyledIcon, {
11
+ role: 'presentation',
12
+ ...restProps,
13
+ 'data-icon-name': name,
14
+ ref
15
+ });
16
+ })
17
+ };
18
+ });
19
+ export {};
20
+ //# sourceMappingURL=iconMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconMock.js","sourceRoot":"","sources":["../../src/mocks/iconMock.ts"],"names":[],"mappings":"AAIA,IAAI,CAAC,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IACjE,gHAAgH;IAChH,oFAAoF;IACpF,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,aAAa,CAAyB,OAAO,CAAC,CAAC;IAE1F,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAC5B,kDAAkD,CACnD,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,GAAG,GAAG;QACN,OAAO,EAAE,UAAU,CAAC,SAAS,QAAQ,CACnC,EAAE,IAAI,EAAE,GAAG,SAAS,EAA8B,EAClD,GAAqB;YAErB,OAAO,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE;gBACnC,IAAI,EAAE,cAAc;gBACpB,GAAG,SAAS;gBACZ,gBAAgB,EAAE,IAAI;gBACtB,GAAG;aACJ,CAAC,CAAC;QACL,CAAC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import type { PropsWithoutRef } from 'react';\n\nimport type { IconProps } from '@pega/cosmos-react-core';\n\njest.mock('@pega/cosmos-react-core/lib/components/Icon/Icon', () => {\n // Should probably be using global require here in case createElement or forwardRef are themselves being mocked,\n // but that requires including @types/node which throws off type checking for tests.\n const { createElement, forwardRef } = jest.requireActual<typeof import('react')>('react');\n\n const mod = jest.requireActual<typeof import('@pega/cosmos-react-core/lib/components/Icon/Icon')>(\n '@pega/cosmos-react-core/lib/components/Icon/Icon'\n );\n\n return {\n __esModule: true,\n ...mod,\n default: forwardRef(function IconMock(\n { name, ...restProps }: PropsWithoutRef<IconProps>,\n ref: IconProps['ref']\n ) {\n return createElement(mod.StyledIcon, {\n role: 'presentation',\n ...restProps,\n 'data-icon-name': name,\n ref\n });\n })\n };\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import './createRange';
2
+ import './elementFromPointMock';
3
+ import './iconMock';
4
+ import './intersectionObserverMock';
5
+ import './matchMediaMock';
6
+ import './popoverMock';
7
+ import './qrcodeMock';
8
+ import './resizeObserverMock';
9
+ import './useBreakpointMock';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,10 @@
1
+ import './createRange';
2
+ import './elementFromPointMock';
3
+ import './iconMock';
4
+ import './intersectionObserverMock';
5
+ import './matchMediaMock';
6
+ import './popoverMock';
7
+ import './qrcodeMock';
8
+ import './resizeObserverMock';
9
+ import './useBreakpointMock';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=intersectionObserverMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersectionObserverMock.d.ts","sourceRoot":"","sources":["../../src/mocks/intersectionObserverMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
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
+ }));
11
+ //# sourceMappingURL=intersectionObserverMock.js.map
@@ -0,0 +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"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=matchMediaMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchMediaMock.d.ts","sourceRoot":"","sources":["../../src/mocks/matchMediaMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
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
+ }));
12
+ //# sourceMappingURL=matchMediaMock.js.map
@@ -0,0 +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"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=mutationObserverMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutationObserverMock.d.ts","sourceRoot":"","sources":["../../src/mocks/mutationObserverMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ window.MutationObserver = jest.fn(() => {
3
+ return {
4
+ observe: jest.fn(),
5
+ disconnect: jest.fn(),
6
+ takeRecords: jest.fn()
7
+ };
8
+ });
9
+ //# sourceMappingURL=mutationObserverMock.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=popoverMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popoverMock.d.ts","sourceRoot":"","sources":["../../src/mocks/popoverMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ jest.mock('@pega/cosmos-react-core/lib/components/Popover/Popover', () => {
2
+ // Should probably be using global require here in case createElement or forwardRef are themselves being mocked,
3
+ // but that requires including @types/node which throws off type checking for tests.
4
+ const { createElement, forwardRef } = jest.requireActual('react');
5
+ const { default: Popover, ...mod } = jest.requireActual('@pega/cosmos-react-core/lib/components/Popover/Popover');
6
+ return {
7
+ __esModule: true,
8
+ ...mod,
9
+ default: forwardRef(function PopoverMock(props, ref) {
10
+ return createElement(Popover, { ...props, hideOnTargetHidden: false, ref });
11
+ })
12
+ };
13
+ });
14
+ export {};
15
+ //# sourceMappingURL=popoverMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popoverMock.js","sourceRoot":"","sources":["../../src/mocks/popoverMock.ts"],"names":[],"mappings":"AAIA,IAAI,CAAC,IAAI,CAAC,wDAAwD,EAAE,GAAG,EAAE;IACvE,gHAAgH;IAChH,oFAAoF;IACpF,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,aAAa,CAAyB,OAAO,CAAC,CAAC;IAE1F,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,CAErD,wDAAwD,CAAC,CAAC;IAE5D,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,GAAG,GAAG;QACN,OAAO,EAAE,UAAU,CAAC,SAAS,WAAW,CACtC,KAAoC,EACpC,GAAwB;YAExB,OAAO,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9E,CAAC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import type { PropsWithoutRef } from 'react';\n\nimport type { PopoverProps } from '@pega/cosmos-react-core';\n\njest.mock('@pega/cosmos-react-core/lib/components/Popover/Popover', () => {\n // Should probably be using global require here in case createElement or forwardRef are themselves being mocked,\n // but that requires including @types/node which throws off type checking for tests.\n const { createElement, forwardRef } = jest.requireActual<typeof import('react')>('react');\n\n const { default: Popover, ...mod } = jest.requireActual<\n typeof import('@pega/cosmos-react-core/lib/components/Popover/Popover')\n >('@pega/cosmos-react-core/lib/components/Popover/Popover');\n\n return {\n __esModule: true,\n ...mod,\n default: forwardRef(function PopoverMock(\n props: PropsWithoutRef<PopoverProps>,\n ref: PopoverProps['ref']\n ) {\n return createElement(Popover, { ...props, hideOnTargetHidden: false, ref });\n })\n };\n});\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=qrcodeMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcodeMock.d.ts","sourceRoot":"","sources":["../../src/mocks/qrcodeMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ jest.mock('qrcode', () => ({
3
+ toDataURL: () => Promise.resolve('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAAB0CAYAAABUmhYnAAAAAklEQVR4AewaftIAAAK8SURBVO3BQWrgUAwFwX7C979yzyy1+mBsh0SoKv7HGqNYoxRrlGKNUqxRijVKsUYp1ijFGqVYoxRrlGKNUqxRijVKsUYp1igXDyXhJ6l0SehUTpJwotIl4SepPFGsUYo1SrFGuXiZypuScKLSJaFT6VSeUHlTEt5UrFGKNUqxRrn4WBLuUPlSEjqVJ5Jwh8qXijVKsUYp1igXf1wSOpUTlcmKNUqxRinWKBfDJaFT6ZLQqfxlxRqlWKMUa5SLj6n8JknoVJ5Q+U2KNUqxRinWKBcvS8JvptIloVM5ScJvVqxRijVKsUa5eEjlN0lCp9Il4Q6Vv6RYoxRrlGKNcvFQEjqVO5LQqXRJuEOlS8KJSpeEN6mcJKFTeaJYoxRrlGKNcvGxJNyRhE7lJAknKl0SuiR0Km9KQqfypWKNUqxRijXKxcuS0Kl0SehUTpJwovKEykkS3pSETuVNxRqlWKMUa5SLl6mcqHRJ6FQ6lS4JXRLuUDlJwolKl4QTlS4JXyrWKMUapVijxP/4UBK+pNIl4USlS8ITKnck4UTliWKNUqxRijXKxcdUvpSETuVLKl0SOpUuCZ1Kl4Q3FWuUYo1SrFEuHkrCT1I5SUKn8oTKHUnoVLokdCpvKtYoxRqlWKNcvEzlTUk4UemScJKEE5WTJJyo3JGETuWJYo1SrFGKNcrFx5Jwh8odSThJwonKSRJOVE6S0Kl0SXhTsUYp1ijFGuXij1PpktCpdEnoktCpdConSehUTpLwpWKNUqxRijXKxTAqd6icJKFTeULlS8UapVijFGuUi4+p/KQkdCqdykkS7lA5UflJxRqlWKMUa5SLlyXhJyWhU+mS0Kl0SbgjCScqdyShU3miWKMUa5RijRL/Y41RrFGKNUqxRinWKMUapVijFGuUYo1SrFGKNUqxRinWKMUapVijFGuUf87PEfneycvhAAAAAElFTkSuQmCC')
4
+ }));
5
+ //# sourceMappingURL=qrcodeMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcodeMock.js","sourceRoot":"","sources":["../../src/mocks/qrcodeMock.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;IACzB,SAAS,EAAE,GAAG,EAAE,CACd,OAAO,CAAC,OAAO,CACb,4hCAA4hC,CAC7hC;CACJ,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('qrcode', () => ({\n toDataURL: () =>\n Promise.resolve(\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAAB0CAYAAABUmhYnAAAAAklEQVR4AewaftIAAAK8SURBVO3BQWrgUAwFwX7C979yzyy1+mBsh0SoKv7HGqNYoxRrlGKNUqxRijVKsUYp1ijFGqVYoxRrlGKNUqxRijVKsUYp1igXDyXhJ6l0SehUTpJwotIl4SepPFGsUYo1SrFGuXiZypuScKLSJaFT6VSeUHlTEt5UrFGKNUqxRrn4WBLuUPlSEjqVJ5Jwh8qXijVKsUYp1igXf1wSOpUTlcmKNUqxRinWKBfDJaFT6ZLQqfxlxRqlWKMUa5SLj6n8JknoVJ5Q+U2KNUqxRinWKBcvS8JvptIloVM5ScJvVqxRijVKsUa5eEjlN0lCp9Il4Q6Vv6RYoxRrlGKNcvFQEjqVO5LQqXRJuEOlS8KJSpeEN6mcJKFTeaJYoxRrlGKNcvGxJNyRhE7lJAknKl0SuiR0Km9KQqfypWKNUqxRijXKxcuS0Kl0SehUTpJwovKEykkS3pSETuVNxRqlWKMUa5SLl6mcqHRJ6FQ6lS4JXRLuUDlJwolKl4QTlS4JXyrWKMUapVijxP/4UBK+pNIl4USlS8ITKnck4UTliWKNUqxRijXKxcdUvpSETuVLKl0SOpUuCZ1Kl4Q3FWuUYo1SrFEuHkrCT1I5SUKn8oTKHUnoVLokdCpvKtYoxRqlWKNcvEzlTUk4UemScJKEE5WTJJyo3JGETuWJYo1SrFGKNcrFx5Jwh8odSThJwonKSRJOVE6S0Kl0SXhTsUYp1ijFGuXij1PpktCpdEnoktCpdConSehUTpLwpWKNUqxRijXKxTAqd6icJKFTeULlS8UapVijFGuUi4+p/KQkdCqdykkS7lA5UflJxRqlWKMUa5SLlyXhJyWhU+mS0Kl0SbgjCScqdyShU3miWKMUa5RijRL/Y41RrFGKNUqxRinWKMUapVijFGuUYo1SrFGKNUqxRinWKMUapVijFGuUf87PEfneycvhAAAAAElFTkSuQmCC'\n )\n}));\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=resizeObserverMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizeObserverMock.d.ts","sourceRoot":"","sources":["../../src/mocks/resizeObserverMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ window.ResizeObserver = jest.fn(() => ({
3
+ observe: () => { },
4
+ unobserve: () => { },
5
+ disconnect: () => { }
6
+ }));
7
+ //# sourceMappingURL=resizeObserverMock.js.map
@@ -0,0 +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"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=useBreakpointMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpointMock.d.ts","sourceRoot":"","sources":["../../src/mocks/useBreakpointMock.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ jest.mock('@pega/cosmos-react-core/lib/hooks', () => {
3
+ const { themeDefinition } = jest.requireActual('@pega/cosmos-react-core/lib/theme');
4
+ return {
5
+ __esModule: true,
6
+ ...jest.requireActual('@pega/cosmos-react-core/lib/hooks'),
7
+ useBreakpoint: (bp) => {
8
+ return (window.innerWidth / 16 >= Number.parseFloat(themeDefinition.base.breakpoints[bp].$value));
9
+ }
10
+ };
11
+ });
12
+ //# sourceMappingURL=useBreakpointMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpointMock.js","sourceRoot":"","sources":["../../src/mocks/useBreakpointMock.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAClD,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,aAAa,CAE5C,mCAAmC,CAAC,CAAC;IAEvC,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,GAAG,IAAI,CAAC,aAAa,CACnB,mCAAmC,CACpC;QAED,aAAa,EAAE,CAAC,EAAiD,EAAE,EAAE;YACnE,OAAO,CACL,MAAM,CAAC,UAAU,GAAG,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CACzF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('@pega/cosmos-react-core/lib/hooks', () => {\n const { themeDefinition } = jest.requireActual<\n typeof import('@pega/cosmos-react-core/lib/theme')\n >('@pega/cosmos-react-core/lib/theme');\n\n return {\n __esModule: true,\n ...jest.requireActual<typeof import('@pega/cosmos-react-core/lib/hooks')>(\n '@pega/cosmos-react-core/lib/hooks'\n ),\n\n useBreakpoint: (bp: keyof typeof themeDefinition.base.breakpoints) => {\n return (\n window.innerWidth / 16 >= Number.parseFloat(themeDefinition.base.breakpoints[bp].$value)\n );\n }\n };\n});\n"]}
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-test-utils",
3
- "version": "4.0.0-dev.9.1",
4
- "author": "Pegasystems",
5
- "license": "SEE LICENSE IN LICENSE",
3
+ "version": "4.0.0-rc.1",
6
4
  "repository": {
7
5
  "type": "git",
8
6
  "url": "https://github.com/pegasystems/cosmos-react.git",
9
7
  "directory": "packages/cosmos-test-utils"
10
8
  },
9
+ "license": "SEE LICENSE IN LICENSE",
10
+ "author": "Pegasystems",
11
+ "sideEffects": [
12
+ "./src/mocks/*.ts",
13
+ "./lib/mocks/*.js"
14
+ ],
11
15
  "main": "lib/index.js",
12
16
  "types": "lib/index.d.ts",
13
17
  "files": [
14
18
  "LICENSE",
15
19
  "lib"
16
20
  ],
17
- "sideEffects": [
18
- "./src/mocks/*.ts",
19
- "./lib/mocks/*.js"
20
- ],
21
21
  "scripts": {
22
22
  "build": "tsc -b"
23
23
  },
24
24
  "dependencies": {
25
- "@pega/cosmos-react-core": "4.0.0-dev.9.1",
25
+ "@pega/cosmos-react-core": "4.0.0-rc.1",
26
26
  "@testing-library/react": "^12.1.3",
27
- "@types/jest": "^26.0.0",
27
+ "@types/jest": "^29.5.1",
28
28
  "@types/react": "^16.14.24 || ^17.0.38",
29
29
  "@types/react-dom": "^16.9.14 || ^17.0.11",
30
30
  "react": "^16.14.0 || ^17.0.0",
31
31
  "react-dom": "^16.14.0 || ^17.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "typescript": "~4.7.2"
34
+ "typescript": "~5.0.2"
35
35
  }
36
36
  }