@pie-lib/test-utils 0.9.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -3,46 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.9.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.9.0) (2025-07-31)
7
-
8
- **Note:** Version bump only for package @pie-lib/test-utils
6
+ # [0.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.11.0) (2025-08-07)
9
7
 
10
8
 
9
+ ### Features
11
10
 
11
+ * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
12
12
 
13
13
 
14
- # [0.8.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.8.0) (2025-07-31)
15
-
16
- **Note:** Version bump only for package @pie-lib/test-utils
17
14
 
18
15
 
19
16
 
17
+ # [0.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.10.0) (2025-07-31)
20
18
 
19
+ **Note:** Version bump only for package @pie-lib/test-utils
21
20
 
22
- # [0.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.7.0) (2025-07-31)
21
+ # [0.9.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.9.0) (2025-07-31)
23
22
 
24
23
  **Note:** Version bump only for package @pie-lib/test-utils
25
24
 
25
+ # [0.8.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.8.0) (2025-07-31)
26
26
 
27
+ **Note:** Version bump only for package @pie-lib/test-utils
27
28
 
29
+ # [0.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.7.0) (2025-07-31)
28
30
 
31
+ **Note:** Version bump only for package @pie-lib/test-utils
29
32
 
30
33
  # [0.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.6.0) (2025-07-31)
31
34
 
32
35
  **Note:** Version bump only for package @pie-lib/test-utils
33
36
 
34
-
35
-
36
-
37
-
38
37
  # [0.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.5.0) (2025-07-31)
39
38
 
40
39
  **Note:** Version bump only for package @pie-lib/test-utils
41
40
 
42
-
43
-
44
-
45
-
46
41
  # [0.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.7.0) (2025-07-31)
47
42
 
48
43
  **Note:** Version bump only for package @pie-lib/test-utils
package/lib/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.shallowChild = shallowChild;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var React = _interopRequireWildcard(require("react"));
15
+
16
+ var _enzyme = require("enzyme");
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function shallowChild(Component) {
23
+ var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24
+ var nestLevel = arguments.length > 2 ? arguments[2] : undefined;
25
+ return function innerRender() {
26
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
27
+ var rendered = (0, _enzyme.shallow)( /*#__PURE__*/React.createElement(Component, (0, _extends2["default"])({}, defaultProps, props)));
28
+
29
+ if (nestLevel) {
30
+ var repeat = nestLevel;
31
+
32
+ while (repeat--) {
33
+ rendered = rendered.first().shallow();
34
+ }
35
+ }
36
+
37
+ return rendered;
38
+ };
39
+ }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"names":["shallowChild","Component","defaultProps","nestLevel","innerRender","props","rendered","repeat","first","shallow"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEO,SAASA,YAAT,CAAsBC,SAAtB,EAA+D;AAAA,MAA9BC,YAA8B,uEAAf,EAAe;AAAA,MAAXC,SAAW;AACpE,SAAO,SAASC,WAAT,GAAiC;AAAA,QAAZC,KAAY,uEAAJ,EAAI;AACtC,QAAIC,QAAQ,GAAG,mCAAQ,oBAAC,SAAD,gCAAeJ,YAAf,EAAiCG,KAAjC,EAAR,CAAf;;AAEA,QAAIF,SAAJ,EAAe;AACb,UAAII,MAAM,GAAGJ,SAAb;;AAEA,aAAOI,MAAM,EAAb,EAAiB;AACfD,QAAAA,QAAQ,GAAGA,QAAQ,CAACE,KAAT,GAAiBC,OAAjB,EAAX;AACD;AACF;;AAED,WAAOH,QAAP;AACD,GAZD;AAaD","sourcesContent":["import * as React from 'react';\nimport { shallow } from 'enzyme';\n\nexport function shallowChild(Component, defaultProps = {}, nestLevel) {\n return function innerRender(props = {}) {\n let rendered = shallow(<Component {...defaultProps} {...props} />);\n\n if (nestLevel) {\n let repeat = nestLevel;\n\n while (repeat--) {\n rendered = rendered.first().shallow();\n }\n }\n\n return rendered;\n };\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/test-utils",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -13,6 +13,6 @@
13
13
  "enzyme": "^3.8.0",
14
14
  "react": "^16.8.1"
15
15
  },
16
- "gitHead": "b52ffaa60bc5a96e2ead9c2f6cfcd17e2db058f7",
16
+ "gitHead": "ba75c393e47a34ace71e2ee5c3a2ddd3b87423ec",
17
17
  "scripts": {}
18
18
  }