@codecademy/gamut-tests 5.2.15-alpha.3e8b72.0 → 5.2.15-alpha.3ee88c.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.
@@ -0,0 +1,10 @@
1
+ import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
2
+ import * as React from 'react';
3
+ export declare const MockGamutProvider: React.FC<{
4
+ children?: React.ReactNode;
5
+ }>;
6
+ /**
7
+ * @deprecated Enzyme is no longer being maintained. Use RTL instead.
8
+ */
9
+ export declare const setupEnzyme: typeof setupEnzymeBase;
10
+ export declare const setupRtl: typeof setupRtlBase;
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ import { GamutProvider, theme } from '@codecademy/gamut-styles';
2
+ import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
3
+ import overArgs from 'lodash/overArgs';
4
+ import * as React from 'react';
5
+
6
+ // See https://www.notion.so/codecademy/Frontend-Unit-Tests-1cbf4e078a6647559b4583dfb6d3cb18 for more info
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export const MockGamutProvider = ({
9
+ children
10
+ }) => {
11
+ return /*#__PURE__*/_jsx(GamutProvider, {
12
+ theme: theme,
13
+ useCache: false,
14
+ useGlobals: false,
15
+ children: children
16
+ });
17
+ };
18
+ function withMockGamutProvider(WrappedComponent) {
19
+ const WithBoundaryComponent = props => /*#__PURE__*/_jsx(MockGamutProvider, {
20
+ children: /*#__PURE__*/_jsx(WrappedComponent, {
21
+ ...props
22
+ })
23
+ });
24
+ return WithBoundaryComponent;
25
+ }
26
+
27
+ // overArgs isn't fully typed yet for lack of curried generics, so we have to cast it...
28
+
29
+ /**
30
+ * @deprecated Enzyme is no longer being maintained. Use RTL instead.
31
+ */
32
+ export const setupEnzyme = overArgs(setupEnzymeBase, withMockGamutProvider);
33
+ export const setupRtl = overArgs(setupRtlBase, withMockGamutProvider);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@codecademy/gamut-tests",
3
3
  "description": "Shared component test setup for Gamut applications",
4
- "version": "5.2.15-alpha.3e8b72.0",
4
+ "version": "5.2.15-alpha.3ee88c.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/gamut-styles": "17.9.1-alpha.3e8b72.0",
7
+ "@codecademy/gamut-styles": "17.9.1-alpha.3ee88c.0",
8
8
  "component-test-setup": "*",
9
9
  "lodash": "^4.17.5"
10
10
  },
@@ -33,5 +33,5 @@
33
33
  "verify": "tsc --noEmit"
34
34
  },
35
35
  "types": "./dist/index.d.ts",
36
- "gitHead": "3eab6a6745552c0c03fb049875d22255f5a34a13"
36
+ "gitHead": "cf0c61abef53be300f548e66ecd1091ef7bc297d"
37
37
  }