@dynatrace/strato-components-testing 1.6.0 → 1.6.2

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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/jest/custom-render.tsx"],
4
- "sourcesContent": ["/* eslint-disable no-restricted-imports */\nimport {\n render as rtlRender,\n RenderOptions,\n RenderResult,\n} from '@testing-library/react';\nimport React, { PropsWithChildren } from 'react';\nimport { IntlProvider } from 'react-intl';\n\ninterface AllProvidersProps {\n locale?: string;\n timeZone?: string;\n}\n\n/** The wrapper component to always have the providers in place */\nconst AllProviders = ({\n children,\n locale = 'en',\n timeZone = 'UTC',\n}: PropsWithChildren<AllProvidersProps>) => {\n return (\n <IntlProvider locale={locale} timeZone={timeZone}>\n {children}\n </IntlProvider>\n );\n};\n\n/**\n * @public\n */\nexport type RenderWithIntlOptions = {\n locale?: string;\n timeZone?: string;\n} & Omit<RenderOptions, 'queries'>;\n\nconst DefaultWrapper = (props: PropsWithChildren<unknown>) => (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>{props.children}</>\n);\n\n/**\n * Wrapper to render components with all required providers\n * @public\n */\nexport const customRender = (\n ui: React.ReactElement,\n {\n locale = 'en',\n timeZone = 'UTC',\n wrapper: CustomWrapper = DefaultWrapper,\n ...renderOptions\n }: RenderWithIntlOptions = {},\n): RenderResult =>\n rtlRender(ui, {\n wrapper: ({ children }) => (\n <AllProviders locale={locale} timeZone={timeZone}>\n <CustomWrapper>{children}</CustomWrapper>\n </AllProviders>\n ),\n ...renderOptions,\n });\n"],
4
+ "sourcesContent": ["/* eslint-disable no-restricted-imports */\nimport {\n render as rtlRender,\n RenderOptions,\n RenderResult,\n} from '@testing-library/react';\nimport { type PropsWithChildren, type ReactElement } from 'react';\nimport { IntlProvider } from 'react-intl';\n\ninterface AllProvidersProps {\n locale?: string;\n timeZone?: string;\n}\n\n/** The wrapper component to always have the providers in place */\nconst AllProviders = ({\n children,\n locale = 'en',\n timeZone = 'UTC',\n}: PropsWithChildren<AllProvidersProps>) => {\n return (\n <IntlProvider locale={locale} timeZone={timeZone}>\n {children}\n </IntlProvider>\n );\n};\n\n/**\n * @public\n */\nexport type RenderWithIntlOptions = {\n locale?: string;\n timeZone?: string;\n} & Omit<RenderOptions, 'queries'>;\n\nconst DefaultWrapper = (props: PropsWithChildren<unknown>) => (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>{props.children}</>\n);\n\n/**\n * Wrapper to render components with all required providers\n * @public\n */\nexport const customRender = (\n ui: ReactElement,\n {\n locale = 'en',\n timeZone = 'UTC',\n wrapper: CustomWrapper = DefaultWrapper,\n ...renderOptions\n }: RenderWithIntlOptions = {},\n): RenderResult =>\n rtlRender(ui, {\n wrapper: ({ children }) => (\n <AllProviders locale={locale} timeZone={timeZone}>\n <CustomWrapper>{children}</CustomWrapper>\n </AllProviders>\n ),\n ...renderOptions,\n });\n"],
5
5
  "mappings": "AAqBI,SAgBF,UAhBE;AApBJ;AAAA,EACE,UAAU;AAAA,OAGL;AAEP,SAAS,oBAAoB;AAQ7B,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AACb,MAA4C;AAC1C,SACE,oBAAC,gBAAa,QAAgB,UAC3B,UACH;AAEJ;AAUA,MAAM,iBAAiB,CAAC;AAAA;AAAA,EAEtB,gCAAG,gBAAM,UAAS;AAAA;AAOb,MAAM,eAAe,CAC1B,IACA;AAAA,EACE,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS,gBAAgB;AAAA,EACzB,GAAG;AACL,IAA2B,CAAC,MAE5B,UAAU,IAAI;AAAA,EACZ,SAAS,CAAC,EAAE,SAAS,MACnB,oBAAC,gBAAa,QAAgB,UAC5B,8BAAC,iBAAe,UAAS,GAC3B;AAAA,EAEF,GAAG;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { RenderOptions, RenderResult } from '@testing-library/react';
2
- import React from 'react';
2
+ import { type ReactElement } from 'react';
3
3
  /**
4
4
  * @public
5
5
  */
@@ -11,4 +11,4 @@ export type RenderWithIntlOptions = {
11
11
  * Wrapper to render components with all required providers
12
12
  * @public
13
13
  */
14
- export declare const customRender: (ui: React.ReactElement, { locale, timeZone, wrapper: CustomWrapper, ...renderOptions }?: RenderWithIntlOptions) => RenderResult;
14
+ export declare const customRender: (ui: ReactElement, { locale, timeZone, wrapper: CustomWrapper, ...renderOptions }?: RenderWithIntlOptions) => RenderResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/strato-components-testing",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "types": "./index.d.ts",
@@ -30,9 +30,9 @@
30
30
  }
31
31
  },
32
32
  "peerDependencies": {
33
- "@testing-library/react": "^14.0.0 || ^15.0.0",
33
+ "@testing-library/react": "^14.0.0 || ^15.0.0 || ^16.0.0",
34
34
  "@testing-library/user-event": "^14.0.0",
35
- "framer-motion": "^11.3.19",
35
+ "framer-motion": "^11.3.19 || ^12.0.0",
36
36
  "react": "^18.0.0",
37
37
  "react-dom": "^18.0.0",
38
38
  "react-intl": "^6.0.8 || ^7.0.0",