@pega/cosmos-react-test-utils 4.0.0-dev.18.1 → 4.0.0-dev.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/mocks/iconMock.d.ts.map +1 -1
- package/lib/mocks/iconMock.js +11 -4
- package/lib/mocks/iconMock.js.map +1 -1
- package/lib/mocks/index.d.ts +1 -0
- package/lib/mocks/index.d.ts.map +1 -1
- package/lib/mocks/index.js +1 -0
- package/lib/mocks/index.js.map +1 -1
- package/lib/mocks/popoverMock.d.ts +2 -0
- package/lib/mocks/popoverMock.d.ts.map +1 -0
- package/lib/mocks/popoverMock.js +15 -0
- package/lib/mocks/popoverMock.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconMock.d.ts","sourceRoot":"","sources":["../../src/mocks/iconMock.
|
|
1
|
+
{"version":3,"file":"iconMock.d.ts","sourceRoot":"","sources":["../../src/mocks/iconMock.ts"],"names":[],"mappings":""}
|
package/lib/mocks/iconMock.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
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');
|
|
4
5
|
const mod = jest.requireActual('@pega/cosmos-react-core/lib/components/Icon/Icon');
|
|
5
6
|
return {
|
|
6
7
|
__esModule: true,
|
|
7
8
|
...mod,
|
|
8
|
-
default: forwardRef(function
|
|
9
|
-
return
|
|
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
|
+
});
|
|
10
16
|
})
|
|
11
17
|
};
|
|
12
18
|
});
|
|
19
|
+
export {};
|
|
13
20
|
//# sourceMappingURL=iconMock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconMock.js","sourceRoot":"","sources":["../../src/mocks/iconMock.
|
|
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"]}
|
package/lib/mocks/index.d.ts
CHANGED
package/lib/mocks/index.d.ts.map
CHANGED
|
@@ -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,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,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"}
|
package/lib/mocks/index.js
CHANGED
package/lib/mocks/index.js.map
CHANGED
|
@@ -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,cAAc,CAAC;AACtB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC","sourcesContent":["import './createRange';\nimport './elementFromPointMock';\nimport './iconMock';\nimport './intersectionObserverMock';\nimport './matchMediaMock';\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,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
|
+
{"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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-test-utils",
|
|
3
|
-
"version": "4.0.0-dev.18.
|
|
3
|
+
"version": "4.0.0-dev.18.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pegasystems/cosmos-react.git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsc -b"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@pega/cosmos-react-core": "4.0.0-dev.18.
|
|
25
|
+
"@pega/cosmos-react-core": "4.0.0-dev.18.3",
|
|
26
26
|
"@testing-library/react": "^12.1.3",
|
|
27
27
|
"@types/jest": "^29.5.1",
|
|
28
28
|
"@types/react": "^16.14.24 || ^17.0.38",
|