@codecademy/gamut-tests 5.1.4-alpha.fb11f2.0 → 5.1.4
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/dist/index.js +15 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
7
|
import { GamutProvider, theme } from '@codecademy/gamut-styles';
|
|
2
8
|
import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
|
|
3
9
|
import overArgs from 'lodash/overArgs';
|
|
@@ -5,10 +11,8 @@ import * as React from 'react';
|
|
|
5
11
|
|
|
6
12
|
// See https://www.notion.so/codecademy/Frontend-Unit-Tests-1cbf4e078a6647559b4583dfb6d3cb18 for more info
|
|
7
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
children
|
|
11
|
-
} = _ref;
|
|
14
|
+
export var MockGamutProvider = function MockGamutProvider(_ref) {
|
|
15
|
+
var children = _ref.children;
|
|
12
16
|
return /*#__PURE__*/_jsx(GamutProvider, {
|
|
13
17
|
useGlobals: false,
|
|
14
18
|
useCache: false,
|
|
@@ -17,11 +21,11 @@ export const MockGamutProvider = _ref => {
|
|
|
17
21
|
});
|
|
18
22
|
};
|
|
19
23
|
function withMockGamutProvider(WrappedComponent) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
}
|
|
24
|
+
var WithBoundaryComponent = function WithBoundaryComponent(props) {
|
|
25
|
+
return /*#__PURE__*/_jsx(MockGamutProvider, {
|
|
26
|
+
children: /*#__PURE__*/_jsx(WrappedComponent, _objectSpread({}, props))
|
|
27
|
+
});
|
|
28
|
+
};
|
|
25
29
|
return WithBoundaryComponent;
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -30,5 +34,5 @@ function withMockGamutProvider(WrappedComponent) {
|
|
|
30
34
|
/**
|
|
31
35
|
* @deprecated Enzyme is no longer being maintained. Use RTL instead.
|
|
32
36
|
*/
|
|
33
|
-
export
|
|
34
|
-
export
|
|
37
|
+
export var setupEnzyme = overArgs(setupEnzymeBase, withMockGamutProvider);
|
|
38
|
+
export var 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.1.4
|
|
4
|
+
"version": "5.1.4",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codecademy/gamut-styles": "17.1.2
|
|
7
|
+
"@codecademy/gamut-styles": "17.1.2",
|
|
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": "
|
|
36
|
+
"gitHead": "0621dd5f80535233e947dd5122c5ab5184f7a665"
|
|
37
37
|
}
|