@pega/cosmos-react-test-utils 5.0.0-dev.6.2 → 5.0.0-dev.7.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.
@@ -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,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,UAAU,aAAa;IACrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,kBAAkB,CAAC,EAAE,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACjE;AAED,eAAO,MAAM,MAAM,YAAa,YAAY,YAAW,aAAa,iIAWnE,CAAC;AAEF,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,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,UAAU,aAAa;IACrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,kBAAkB,CAAC,EAAE,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACjE;AAeD,eAAO,MAAM,MAAM,YAAa,YAAY,YAAW,aAAa,iIAKnE,CAAC;AAEF,eAAO,MAAM,YAAY,MAAO,MAAM,KAAK,MAAM,SAIhD,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { render as rtlRender } from '@testing-library/react';
3
3
  import { Configuration, ModalManager, PopoverManager, Toaster } from '@pega/cosmos-react-core';
4
+ const Providers = (configurationProps) => ({ children }) => (_jsx(Configuration, { ...configurationProps, children: _jsx(PopoverManager, { children: _jsx(Toaster, { dismissAfter: 5000, children: _jsx(ModalManager, { children: children }) }) }) }));
4
5
  export const render = (content, options = {}) => {
5
- return rtlRender(_jsx(Configuration, { ...options.configurationProps, children: _jsx(PopoverManager, { children: _jsx(Toaster, { dismissAfter: 5000, children: _jsx(ModalManager, { children: content }) }) }) }), options.rtlRenderOptions);
6
+ return rtlRender(content, {
7
+ wrapper: Providers(options.configurationProps),
8
+ ...options.rtlRenderOptions
9
+ });
6
10
  };
7
11
  export const resizeWindow = (x, y) => {
8
12
  window.innerWidth = x;
@@ -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;AAG7D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAQ/F,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAqB,EAAE,UAAyB,EAAE,EAAE,EAAE;IAC3E,OAAO,SAAS,CACd,KAAC,aAAa,OAAK,OAAO,CAAC,kBAAkB,YAC3C,KAAC,cAAc,cACb,KAAC,OAAO,IAAC,YAAY,EAAE,IAAI,YACzB,KAAC,YAAY,cAAE,OAAO,GAAgB,GAC9B,GACK,GACH,EAChB,OAAO,CAAC,gBAAgB,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,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 as RTLRenderOptions } from '@testing-library/react';\n\nimport { Configuration, ModalManager, PopoverManager, Toaster } from '@pega/cosmos-react-core';\nimport type { ConfigurationProps, OmitStrict } from '@pega/cosmos-react-core';\n\ninterface RenderOptions {\n rtlRenderOptions?: RTLRenderOptions;\n configurationProps?: OmitStrict<ConfigurationProps, 'children'>;\n}\n\nexport const render = (content: ReactElement, options: RenderOptions = {}) => {\n return rtlRender(\n <Configuration {...options.configurationProps}>\n <PopoverManager>\n <Toaster dismissAfter={5000}>\n <ModalManager>{content}</ModalManager>\n </Toaster>\n </PopoverManager>\n </Configuration>,\n options.rtlRenderOptions\n );\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,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAQ/F,MAAM,SAAS,GACb,CAAC,kBAA+D,EAAE,EAAE,CACpE,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,CAC3C,CACE,KAAC,aAAa,OAAK,kBAAkB,YACnC,KAAC,cAAc,cACb,KAAC,OAAO,IAAC,YAAY,EAAE,IAAI,YACzB,KAAC,YAAY,cAAE,QAAQ,GAAgB,GAC/B,GACK,GACH,CACjB,CAAC;AAEN,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAqB,EAAE,UAAyB,EAAE,EAAE,EAAE;IAC3E,OAAO,SAAS,CAAC,OAAO,EAAE;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAC9C,GAAG,OAAO,CAAC,gBAAgB;KAC5B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,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 as RTLRenderOptions } from '@testing-library/react';\n\nimport { Configuration, ModalManager, PopoverManager, Toaster } from '@pega/cosmos-react-core';\nimport type { ConfigurationProps, OmitStrict } from '@pega/cosmos-react-core';\n\ninterface RenderOptions {\n rtlRenderOptions?: RTLRenderOptions;\n configurationProps?: OmitStrict<ConfigurationProps, 'children'>;\n}\n\nconst Providers =\n (configurationProps?: OmitStrict<ConfigurationProps, 'children'>) =>\n ({ children }: { children: ReactElement }) =>\n (\n <Configuration {...configurationProps}>\n <PopoverManager>\n <Toaster dismissAfter={5000}>\n <ModalManager>{children}</ModalManager>\n </Toaster>\n </PopoverManager>\n </Configuration>\n );\n\nexport const render = (content: ReactElement, options: RenderOptions = {}) => {\n return rtlRender(content, {\n wrapper: Providers(options.configurationProps),\n ...options.rtlRenderOptions\n });\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-test-utils",
3
- "version": "5.0.0-dev.6.2",
3
+ "version": "5.0.0-dev.7.0",
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": "5.0.0-dev.6.2",
25
+ "@pega/cosmos-react-core": "5.0.0-dev.7.0",
26
26
  "@testing-library/react": "^12.1.3",
27
27
  "@types/jest": "^29.5.1",
28
28
  "@types/react": "^17.0.62",