@enact/ui 4.1.1 → 4.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.
Files changed (92) hide show
  1. package/AnnounceDecorator/tests/Announce-specs.js +13 -5
  2. package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +9 -7
  3. package/AnnounceDecorator/tests/useAnnounce-specs.js +25 -17
  4. package/BodyText/BodyText.d.ts +1 -1
  5. package/BodyText/tests/BodyText-specs.js +49 -35
  6. package/Button/Button.d.ts +6 -6
  7. package/Button/Button.js +5 -3
  8. package/Button/tests/Button-specs.js +104 -3
  9. package/CHANGELOG.md +26 -0
  10. package/Cancelable/Cancelable.js +1 -1
  11. package/Cancelable/tests/Cancelable-specs.js +131 -70
  12. package/Changeable/tests/Changeable-specs.js +162 -110
  13. package/FloatingLayer/FloatingLayer.js +5 -17
  14. package/FloatingLayer/tests/FloatingLayer-specs.js +83 -8
  15. package/FloatingLayer/tests/Scrim-specs.js +20 -11
  16. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +15 -9
  17. package/GridListImageItem/GridListImageItem.d.ts +1 -1
  18. package/Group/Group.d.ts +2 -2
  19. package/Group/tests/Group-specs.js +71 -41
  20. package/Heading/Heading.d.ts +2 -1
  21. package/Heading/tests/Heading-specs.js +27 -20
  22. package/Icon/Icon.d.ts +4 -4
  23. package/Icon/tests/Icon-specs.js +52 -31
  24. package/IconButton/IconButton.d.ts +4 -4
  25. package/IconButton/tests/IconButton-specs.js +2 -2
  26. package/Image/tests/Image-specs.js +39 -29
  27. package/ImageItem/tests/ImageItem-specs.js +71 -68
  28. package/Item/tests/Item-specs.js +59 -35
  29. package/LabeledIcon/LabeledIcon.d.ts +4 -4
  30. package/LabeledIcon/tests/LabeledIcon-specs.js +30 -19
  31. package/Layout/Layout.d.ts +16 -16
  32. package/Layout/tests/Layout-specs.js +37 -25
  33. package/Marquee/MarqueeBase.js +1 -5
  34. package/Marquee/MarqueeDecorator.js +6 -3
  35. package/Marquee/index.d.ts +4 -1
  36. package/Marquee/tests/Marquee-specs.js +242 -116
  37. package/Media/Media.js +1 -3
  38. package/ProgressBar/tests/ProgressBar-specs.js +60 -42
  39. package/README.md +1 -1
  40. package/RadioDecorator/RadioDecorator.js +3 -5
  41. package/RadioDecorator/tests/RadioDecorator-specs.js +179 -65
  42. package/Repeater/Repeater.d.ts +2 -1
  43. package/Repeater/tests/Repeater-specs.js +86 -45
  44. package/Routable/Routable.d.ts +2 -2
  45. package/Routable/tests/Routable-specs.js +26 -17
  46. package/Routable/tests/Router-specs.js +65 -41
  47. package/Scrollable/Scrollable.js +2 -1
  48. package/Scrollable/ScrollableNative.js +2 -1
  49. package/Scroller/Scroller.d.ts +2 -14
  50. package/Scroller/ScrollerBasic.js +10 -29
  51. package/Scroller/UiScrollerBase.js +1 -1
  52. package/Skinnable/tests/Skinnable-specs.js +102 -54
  53. package/Skinnable/tests/useSkins-specs.js +37 -42
  54. package/Slider/Slider.d.ts +3 -3
  55. package/Slider/tests/Slider-specs.js +4 -4
  56. package/SlotItem/SlotItem.d.ts +2 -2
  57. package/SlotItem/tests/SlotItem-specs.js +4 -4
  58. package/Slottable/tests/Slottable-specs.js +67 -36
  59. package/Slottable/tests/useSlots-specs.js +68 -35
  60. package/Spinner/Spinner.d.ts +1 -1
  61. package/Spinner/tests/Spinner-specs.js +46 -31
  62. package/ToggleIcon/tests/ToggleIcon-specs.js +32 -20
  63. package/ToggleItem/ToggleItem.d.ts +13 -11
  64. package/ToggleItem/tests/ToggleItem-specs.js +51 -34
  65. package/Toggleable/Toggle.js +6 -6
  66. package/Toggleable/Toggleable.js +6 -12
  67. package/Toggleable/tests/Toggleable-specs.js +428 -324
  68. package/Touchable/Drag.js +13 -17
  69. package/Touchable/Flick.js +20 -16
  70. package/Touchable/Hold.js +14 -19
  71. package/Touchable/Touchable.d.ts +3 -3
  72. package/Touchable/tests/Touchable-specs.js +223 -109
  73. package/Touchable/tests/useTouch-specs.js +159 -84
  74. package/Transition/Transition.d.ts +29 -27
  75. package/Transition/Transition.js +11 -9
  76. package/Transition/tests/Transition-specs.js +111 -31
  77. package/ViewManager/TransitionGroup.js +6 -5
  78. package/ViewManager/View.js +1 -1
  79. package/ViewManager/ViewManager.d.ts +4 -4
  80. package/ViewManager/ViewManager.js +10 -10
  81. package/ViewManager/tests/View-specs.js +109 -81
  82. package/ViewManager/tests/ViewManager-specs.js +471 -185
  83. package/VirtualList/UiVirtualListBase.js +11 -21
  84. package/VirtualList/VirtualList.d.ts +11 -29
  85. package/VirtualList/VirtualListBasic.js +33 -49
  86. package/VirtualList/tests/VirtualList-specs.js +29 -61
  87. package/internal/IdProvider/tests/useId-specs.js +35 -18
  88. package/package.json +11 -11
  89. package/resolution/tests/ResolutionDecorator-specs.js +17 -8
  90. package/styles/mixins.less +14 -2
  91. package/useControlledState/tests/useControlledState-specs.js +67 -42
  92. package/useScroll/useScroll.js +12 -26
@@ -76,7 +76,7 @@ corresponding internal elements and states of this component.
76
76
  * The following classes are supported:
77
77
  * * `slider` - The root component class
78
78
  * * `knob` - The knob node
79
- * * `horizontal` - Applied when `orientation` prop is `"horizontal" ``
79
+ * * `horizontal` - Applied when `orientation` prop is `"horizontal"``
80
80
  * * `pressed` - Applied when `pressed` prop is `true`
81
81
  * * `noFill` - Applied when `noFill` prop is `true`
82
82
  * * `vertical` - Applied when `orientation` prop is `"vertical"`
@@ -108,14 +108,14 @@ will have its props merged with the above props.
108
108
  * The maximum value of the slider.
109
109
  *
110
110
  * The range between `min` and `max` should be evenly divisible by
111
- step .
111
+ [step] .
112
112
  */
113
113
  max?: number;
114
114
  /**
115
115
  * The minimum value of the slider.
116
116
  *
117
117
  * The range between `min` and `max` should be evenly divisible by
118
- step .
118
+ [step] .
119
119
  */
120
120
  min?: number;
121
121
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _enzyme = require("enzyme");
3
+ var _react = require("@testing-library/react");
4
4
 
5
5
  var _Slider = _interopRequireDefault(require("../Slider"));
6
6
 
@@ -15,9 +15,9 @@ describe('Slider', function () {
15
15
 
16
16
  test('should return a DOM node reference for `componentRef`', function () {
17
17
  var ref = jest.fn();
18
- (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider["default"], {
19
- ref: ref,
20
- progressBarComponent: ProgressBar
18
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider["default"], {
19
+ progressBarComponent: ProgressBar,
20
+ ref: ref
21
21
  }));
22
22
  var expected = 'DIV';
23
23
  var actual = ref.mock.calls[0][0].nodeName;
@@ -12,7 +12,7 @@ export interface SlotItemBaseProps {
12
12
  * The type of component to use to render the item.
13
13
  *
14
14
  * This component will receive the `inline` prop and any additional unhandled props provided
15
- to `SlotItem` . A derivative of Item is recommended.
15
+ to `SlotItem` . A derivative of [Item] is recommended.
16
16
  */
17
17
  component: React.ComponentType;
18
18
  /**
@@ -49,7 +49,7 @@ corresponding internal elements and states of this component.
49
49
  * * `after` - Applied to the slot that falls after the content
50
50
  * * `before` - Applied to the slot that falls before the content
51
51
  * * `hidden` - Applied to a slot when that slot is supposed to be hidden, according to
52
- `autoHide` prop
52
+ `autoHide` prop
53
53
  */
54
54
  css?: object;
55
55
  /**
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _react = require("react");
3
+ var _react = require("@testing-library/react");
4
4
 
5
- var _enzyme = require("enzyme");
5
+ var _react2 = require("react");
6
6
 
7
7
  var _SlotItem = _interopRequireDefault(require("../SlotItem"));
8
8
 
@@ -12,13 +12,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
12
12
 
13
13
  describe('SlotItem', function () {
14
14
  test('should return a DOM node reference for `componentRef`', function () {
15
- var component = /*#__PURE__*/(0, _react.forwardRef)(function (props, fn) {
15
+ var component = /*#__PURE__*/(0, _react2.forwardRef)(function (props, fn) {
16
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
17
17
  ref: fn
18
18
  });
19
19
  });
20
20
  var ref = jest.fn();
21
- (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SlotItem["default"], {
21
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SlotItem["default"], {
22
22
  ref: ref,
23
23
  component: component
24
24
  }));
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _enzyme = require("enzyme");
4
-
5
3
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
6
4
 
5
+ require("@testing-library/jest-dom");
6
+
7
+ var _react = require("@testing-library/react");
8
+
7
9
  var _Slottable = _interopRequireDefault(require("../Slottable"));
8
10
 
9
11
  var _jsxRuntime = require("react/jsx-runtime");
@@ -20,10 +22,11 @@ describe('Slottable Specs', function () {
20
22
  b = _ref.b,
21
23
  c = _ref.c;
22
24
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
25
+ "data-testid": "slottable",
23
26
  children: [c, b, a]
24
27
  });
25
28
  });
26
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
29
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
27
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
28
31
  slot: "a",
29
32
  children: "A"
@@ -35,9 +38,11 @@ describe('Slottable Specs', function () {
35
38
  children: "C"
36
39
  })]
37
40
  }));
41
+
42
+ var actual = _react.screen.getByTestId('slottable');
43
+
38
44
  var expected = 'CBA';
39
- var actual = subject.text();
40
- expect(actual).toBe(expected);
45
+ expect(actual.textContent).toBe(expected);
41
46
  });
42
47
  test('should distribute children with a \'type\' that matches a slot', function () {
43
48
  var Component = (0, _Slottable["default"])({
@@ -48,10 +53,11 @@ describe('Slottable Specs', function () {
48
53
  c = _ref2.c,
49
54
  custom = _ref2.custom;
50
55
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
56
+ "data-testid": "slottable",
51
57
  children: [c, b, a, custom]
52
58
  });
53
59
  });
54
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
60
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
55
61
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
56
62
  slot: "a",
57
63
  children: "A"
@@ -65,9 +71,11 @@ describe('Slottable Specs', function () {
65
71
  children: "C"
66
72
  })]
67
73
  }));
74
+
75
+ var actual = _react.screen.getByTestId('slottable');
76
+
68
77
  var expected = 'CBAD';
69
- var actual = subject.text();
70
- expect(actual).toBe(expected);
78
+ expect(actual.textContent).toBe(expected);
71
79
  });
72
80
  test('should distribute children whose \'type\' has a \'defaultSlot\' property that matches a slot', function () {
73
81
  var Custom = (0, _kind["default"])({
@@ -87,10 +95,11 @@ describe('Slottable Specs', function () {
87
95
  b = _ref4.b,
88
96
  c = _ref4.c;
89
97
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
98
+ "data-testid": "slottable",
90
99
  children: [c, b, a]
91
100
  });
92
101
  });
93
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
102
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
94
103
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
95
104
  slot: "a",
96
105
  children: "A"
@@ -102,8 +111,10 @@ describe('Slottable Specs', function () {
102
111
  })]
103
112
  }));
104
113
  var expected = 'CBA';
105
- var actual = subject.text();
106
- expect(actual).toBe(expected);
114
+
115
+ var actual = _react.screen.getByTestId('slottable');
116
+
117
+ expect(actual.textContent).toBe(expected);
107
118
  });
108
119
  test('should distribute children with no \'slot\' property to Slottable\'s \'children\'', function () {
109
120
  var Component = (0, _Slottable["default"])({
@@ -113,10 +124,11 @@ describe('Slottable Specs', function () {
113
124
  b = _ref5.b,
114
125
  children = _ref5.children;
115
126
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
127
+ "data-testid": "slottable",
116
128
  children: [children, b, a]
117
129
  });
118
130
  });
119
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
131
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
120
132
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
121
133
  slot: "a",
122
134
  children: "A"
@@ -128,8 +140,10 @@ describe('Slottable Specs', function () {
128
140
  })]
129
141
  }));
130
142
  var expected = 'CBA';
131
- var actual = subject.text();
132
- expect(actual).toBe(expected);
143
+
144
+ var actual = _react.screen.getByTestId('slottable');
145
+
146
+ expect(actual.textContent).toBe(expected);
133
147
  });
134
148
  test('should not distribute children with an invalid \'slot\' property', function () {
135
149
  // Modify the console spy to silence error output with
@@ -142,10 +156,11 @@ describe('Slottable Specs', function () {
142
156
  b = _ref6.b,
143
157
  c = _ref6.c;
144
158
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
159
+ "data-testid": "slottable",
145
160
  children: [c, b, a]
146
161
  });
147
162
  });
148
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
163
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
149
164
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
150
165
  slot: "a",
151
166
  children: "A"
@@ -158,8 +173,10 @@ describe('Slottable Specs', function () {
158
173
  })]
159
174
  }));
160
175
  var expected = 'BA';
161
- var actual = subject.text();
162
- expect(actual).toBe(expected); // Check to make sure that we only get the one expected error
176
+
177
+ var actual = _react.screen.getByTestId('slottable');
178
+
179
+ expect(actual.textContent).toBe(expected); // Check to make sure that we only get the one expected error
163
180
 
164
181
  var actualErrorsLength = console.error.mock.calls.length;
165
182
  var expectedErrorLength = 1;
@@ -178,10 +195,11 @@ describe('Slottable Specs', function () {
178
195
  custom = _ref7.custom;
179
196
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
180
197
  className: "root-div",
198
+ "data-testid": "slottable",
181
199
  children: [c, b, a, custom]
182
200
  });
183
201
  });
184
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
202
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
185
203
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
186
204
  slot: "a",
187
205
  title: "Div A"
@@ -196,11 +214,15 @@ describe('Slottable Specs', function () {
196
214
  })]
197
215
  }));
198
216
  var expected = 'CBD';
199
- var actual = subject.text();
200
- expect(actual).toBe(expected);
217
+
218
+ var actual = _react.screen.getByTestId('slottable');
219
+
220
+ expect(actual.textContent).toBe(expected);
201
221
  var expectedTitle = 'Div A';
202
- var actualTitle = subject.find('.root-div').childAt(2).prop('title');
203
- expect(actualTitle).toBe(expectedTitle);
222
+
223
+ var actualChild = _react.screen.getByTestId('slottable').children[2];
224
+
225
+ expect(actualChild).toHaveAttribute('title', expectedTitle);
204
226
  });
205
227
  test('should preserve values in \'slot\' property', function () {
206
228
  // This suppresses the unique key warning that this implementation creates. Also, we can't
@@ -211,10 +233,11 @@ describe('Slottable Specs', function () {
211
233
  }, function (_ref8) {
212
234
  var a = _ref8.a;
213
235
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
236
+ "data-testid": "slottable",
214
237
  children: a
215
238
  });
216
239
  });
217
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
240
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
218
241
  a: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
219
242
  children: "X"
220
243
  }, "X"),
@@ -224,8 +247,10 @@ describe('Slottable Specs', function () {
224
247
  }, "A")
225
248
  }));
226
249
  var expected = 'XA';
227
- var actual = subject.text();
228
- expect(actual).toBe(expected);
250
+
251
+ var actual = _react.screen.getByTestId('slottable');
252
+
253
+ expect(actual.textContent).toBe(expected);
229
254
  });
230
255
  test('should add values to existing array in \'slot\' property', function () {
231
256
  var Component = (0, _Slottable["default"])({
@@ -233,12 +258,13 @@ describe('Slottable Specs', function () {
233
258
  }, function (_ref9) {
234
259
  var a = _ref9.a;
235
260
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
261
+ "data-testid": "slottable",
236
262
  children: a
237
263
  });
238
264
  });
239
265
  /* eslint-disable jsx-a11y/anchor-is-valid */
240
266
 
241
- var subject = (0, _enzyme.shallow)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
267
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
242
268
  a: ['a', 'b'],
243
269
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
244
270
  children: "c"
@@ -246,15 +272,16 @@ describe('Slottable Specs', function () {
246
272
  }));
247
273
  /* eslint-enable jsx-a11y/anchor-is-valid */
248
274
 
249
- var expected = ['a', 'b', 'c'];
250
- var actual = subject.prop('a');
251
- expect(actual).toEqual(expected);
275
+ var actual = _react.screen.getByTestId('slottable');
276
+
277
+ expect(actual).toHaveTextContent('abc');
252
278
  });
253
279
  test('should distribute multiple children with the same slot into the same slot', function () {
254
280
  function ComponentBase(_ref10) {
255
281
  var a = _ref10.a;
256
282
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
257
283
  className: "root-div",
284
+ "data-testid": "slottable",
258
285
  children: a
259
286
  });
260
287
  }
@@ -262,7 +289,7 @@ describe('Slottable Specs', function () {
262
289
  var Component = (0, _Slottable["default"])({
263
290
  slots: ['a']
264
291
  }, ComponentBase);
265
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
292
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
266
293
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
267
294
  slot: "a",
268
295
  children: "A"
@@ -275,13 +302,16 @@ describe('Slottable Specs', function () {
275
302
  })]
276
303
  }));
277
304
  var expected = 'AAA';
278
- var actual = subject.text();
279
- expect(actual).toBe(expected);
305
+
306
+ var actual = _react.screen.getByTestId('slottable');
307
+
308
+ expect(actual.textContent).toBe(expected);
280
309
  });
281
310
  test('should allow downstream component to have default value for unset slot', function () {
282
311
  function ComponentBase(_ref11) {
283
312
  var a = _ref11.a;
284
313
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
314
+ "data-testid": "slottable",
285
315
  children: a
286
316
  });
287
317
  }
@@ -292,9 +322,10 @@ describe('Slottable Specs', function () {
292
322
  var Component = (0, _Slottable["default"])({
293
323
  slots: ['a']
294
324
  }, ComponentBase);
295
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
296
- var expected = ComponentBase.defaultProps.a;
297
- var actual = subject.text();
298
- expect(actual).toBe(expected);
325
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
326
+
327
+ var actual = _react.screen.getByTestId('slottable');
328
+
329
+ expect(actual).toHaveTextContent('Default A');
299
330
  });
300
331
  });
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _enzyme = require("enzyme");
3
+ require("@testing-library/jest-dom");
4
+
5
+ var _react = require("@testing-library/react");
4
6
 
5
7
  var _useSlots = _interopRequireDefault(require("../useSlots"));
6
8
 
@@ -23,11 +25,12 @@ describe('useSlots', function () {
23
25
  children: children
24
26
  });
25
27
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
28
+ "data-testid": "useSlots",
26
29
  children: [slots.c, slots.b, slots.a]
27
30
  });
28
31
  }
29
32
 
30
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
33
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
31
34
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
32
35
  slot: "a",
33
36
  children: "A"
@@ -40,8 +43,10 @@ describe('useSlots', function () {
40
43
  })]
41
44
  }));
42
45
  var expected = 'CBA';
43
- var actual = subject.text();
44
- expect(actual).toBe(expected);
46
+
47
+ var actual = _react.screen.getByTestId('useSlots');
48
+
49
+ expect(actual.textContent).toBe(expected);
45
50
  });
46
51
  test('should have no children when all have been distributed', function () {
47
52
  function Component(_ref2) {
@@ -56,11 +61,12 @@ describe('useSlots', function () {
56
61
  children: children
57
62
  });
58
63
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
64
+ "data-testid": "useSlots",
59
65
  children: slots.children
60
66
  });
61
67
  }
62
68
 
63
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
69
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
64
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
71
  slot: "a",
66
72
  children: "A"
@@ -73,8 +79,10 @@ describe('useSlots', function () {
73
79
  })]
74
80
  }));
75
81
  var expected = '';
76
- var actual = subject.text();
77
- expect(actual).toBe(expected);
82
+
83
+ var actual = _react.screen.getByTestId('useSlots');
84
+
85
+ expect(actual).toHaveTextContent(expected);
78
86
  });
79
87
  test('should distribute children with a \'type\' that matches a slot', function () {
80
88
  function Component(_ref3) {
@@ -91,11 +99,12 @@ describe('useSlots', function () {
91
99
  custom: custom
92
100
  });
93
101
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
102
+ "data-testid": "useSlots",
94
103
  children: [slots.c, slots.b, slots.a, slots.custom]
95
104
  });
96
105
  }
97
106
 
98
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
107
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
99
108
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
100
109
  slot: "a",
101
110
  children: "A"
@@ -110,8 +119,10 @@ describe('useSlots', function () {
110
119
  })]
111
120
  }));
112
121
  var expected = 'CBAD';
113
- var actual = subject.text();
114
- expect(actual).toBe(expected);
122
+
123
+ var actual = _react.screen.getByTestId('useSlots');
124
+
125
+ expect(actual.textContent).toBe(expected);
115
126
  });
116
127
  test('should distribute children whose \'type\' has a \'defaultSlot\' property that matches a slot', function () {
117
128
  function Custom(props) {
@@ -134,11 +145,12 @@ describe('useSlots', function () {
134
145
  children: children
135
146
  });
136
147
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
148
+ "data-testid": "useSlots",
137
149
  children: [slots.c, slots.b, slots.a]
138
150
  });
139
151
  }
140
152
 
141
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
153
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
142
154
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
143
155
  slot: "a",
144
156
  children: "A"
@@ -150,8 +162,10 @@ describe('useSlots', function () {
150
162
  })]
151
163
  }));
152
164
  var expected = 'CBA';
153
- var actual = subject.text();
154
- expect(actual).toBe(expected);
165
+
166
+ var actual = _react.screen.getByTestId('useSlots');
167
+
168
+ expect(actual.textContent).toBe(expected);
155
169
  });
156
170
  test('should distribute children with no \'slot\' property to Slottable\'s \'children\'', function () {
157
171
  function Component(_ref5) {
@@ -164,11 +178,12 @@ describe('useSlots', function () {
164
178
  children: children
165
179
  });
166
180
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
181
+ "data-testid": "useSlots",
167
182
  children: [slots.children, slots.b, slots.a]
168
183
  });
169
184
  }
170
185
 
171
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
186
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
172
187
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
173
188
  slot: "a",
174
189
  children: "A"
@@ -180,8 +195,10 @@ describe('useSlots', function () {
180
195
  })]
181
196
  }));
182
197
  var expected = 'CBA';
183
- var actual = subject.text();
184
- expect(actual).toBe(expected);
198
+
199
+ var actual = _react.screen.getByTestId('useSlots');
200
+
201
+ expect(actual.textContent).toBe(expected);
185
202
  });
186
203
  test('should not distribute children with an invalid \'slot\' property', function () {
187
204
  // Modify the console spy to silence error output with
@@ -198,11 +215,12 @@ describe('useSlots', function () {
198
215
  children: children
199
216
  });
200
217
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
218
+ "data-testid": "useSlots",
201
219
  children: [slots.c, slots.b, slots.a]
202
220
  });
203
221
  }
204
222
 
205
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
223
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
206
224
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
207
225
  slot: "a",
208
226
  children: "A"
@@ -215,8 +233,11 @@ describe('useSlots', function () {
215
233
  })]
216
234
  }));
217
235
  var expected = 'BA';
218
- var actual = subject.text();
219
- expect(actual).toBe(expected); // Check to make sure that we only get the one expected error
236
+
237
+ var actual = _react.screen.getByTestId('useSlots');
238
+
239
+ expect(actual.textContent).toBe(expected);
240
+ expect(actual.textContent).toHaveLength(2); // Check to make sure that we only get the one expected error
220
241
 
221
242
  var actualErrorsLength = console.error.mock.calls.length;
222
243
  var expectedErrorLength = 1;
@@ -241,11 +262,12 @@ describe('useSlots', function () {
241
262
  });
242
263
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
243
264
  className: "root-div",
265
+ "data-testid": "useSlots",
244
266
  children: [slots.c, slots.b, slots.a, slots.custom]
245
267
  });
246
268
  }
247
269
 
248
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
270
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
249
271
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
250
272
  slot: "a",
251
273
  title: "Div A"
@@ -260,11 +282,15 @@ describe('useSlots', function () {
260
282
  })]
261
283
  }));
262
284
  var expected = 'CBD';
263
- var actual = subject.text();
264
- expect(actual).toBe(expected);
285
+
286
+ var actual = _react.screen.getByTestId('useSlots');
287
+
288
+ expect(actual.textContent).toBe(expected);
265
289
  var expectedTitle = 'Div A';
266
- var actualTitle = subject.find('.root-div').childAt(2).prop('title');
267
- expect(actualTitle).toBe(expectedTitle);
290
+
291
+ var actualChild = _react.screen.getByTestId('useSlots').children[2];
292
+
293
+ expect(actualChild).toHaveAttribute('title', expectedTitle);
268
294
  });
269
295
  test('should distribute multiple children with the same slot into the same slot', function () {
270
296
  function Component(_ref8) {
@@ -275,11 +301,12 @@ describe('useSlots', function () {
275
301
  children: children
276
302
  });
277
303
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
304
+ "data-testid": "useSlots",
278
305
  children: slots.a
279
306
  });
280
307
  }
281
308
 
282
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
309
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
283
310
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
284
311
  slot: "a",
285
312
  children: "A"
@@ -292,8 +319,10 @@ describe('useSlots', function () {
292
319
  })]
293
320
  }));
294
321
  var expected = 'AAA';
295
- var actual = subject.text();
296
- expect(actual).toBe(expected);
322
+
323
+ var actual = _react.screen.getByTestId('useSlots');
324
+
325
+ expect(actual.textContent).toBe(expected);
297
326
  });
298
327
  test('should override prop with slot value', function () {
299
328
  function Component(_ref9) {
@@ -304,20 +333,22 @@ describe('useSlots', function () {
304
333
  children: children
305
334
  });
306
335
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
336
+ "data-testid": "useSlots",
307
337
  children: slots.a
308
338
  });
309
339
  }
310
340
 
311
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
341
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
312
342
  a: "B",
313
343
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
314
344
  slot: "a",
315
345
  children: "A"
316
346
  })
317
347
  }));
318
- var expected = 'A';
319
- var actual = subject.text();
320
- expect(actual).toBe(expected);
348
+
349
+ var actual = _react.screen.getByTestId('useSlots');
350
+
351
+ expect(actual).toHaveTextContent('A');
321
352
  });
322
353
  test('should fallback to prop when slot is omitted', function () {
323
354
  function Component(_ref10) {
@@ -328,15 +359,17 @@ describe('useSlots', function () {
328
359
  children: children
329
360
  });
330
361
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
362
+ "data-testid": "useSlots",
331
363
  children: slots.a
332
364
  });
333
365
  }
334
366
 
335
- var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
367
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
336
368
  a: "B"
337
369
  }));
338
- var expected = 'B';
339
- var actual = subject.text();
340
- expect(actual).toBe(expected);
370
+
371
+ var actual = _react.screen.getByTestId('useSlots');
372
+
373
+ expect(actual).toHaveTextContent('B');
341
374
  });
342
375
  });
@@ -26,7 +26,7 @@ changes the rendering tree and where this is used.
26
26
  * * 'container' blocks up to the nearest ancestor with absolute or relative positioning
27
27
  *
28
28
  * When `blockClickOn` is either `'screen'` or `'container'` , a translucent scrim can be added
29
- by setting scrim prop to `true` .
29
+ by setting [scrim] prop to `true` .
30
30
  */
31
31
  blockClickOn?: string | any;
32
32
  /**