@enact/ui 5.0.0-alpha.3 → 5.0.0-alpha.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/AnnounceDecorator/tests/Announce-specs.js +2 -2
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -2
- package/AnnounceDecorator/tests/useAnnounce-specs.js +3 -3
- package/BodyText/tests/BodyText-specs.js +6 -6
- package/Button/tests/Button-specs.js +10 -10
- package/CHANGELOG.md +12 -1
- package/Cancelable/tests/Cancelable-specs.js +17 -17
- package/Changeable/tests/Changeable-specs.js +25 -25
- package/ComponentOverride/ComponentOverride.js +1 -1
- package/FloatingLayer/FloatingLayer.js +1 -1
- package/FloatingLayer/FloatingLayerDecorator.js +1 -1
- package/FloatingLayer/tests/FloatingLayer-specs.js +6 -6
- package/FloatingLayer/tests/Scrim-specs.js +2 -2
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +3 -3
- package/Group/tests/Group-specs.js +11 -11
- package/Heading/tests/Heading-specs.js +14 -14
- package/Icon/tests/Icon-specs.js +9 -9
- package/Image/tests/Image-specs.js +5 -5
- package/ImageItem/tests/ImageItem-specs.js +11 -11
- package/Item/tests/Item-specs.js +7 -7
- package/LabeledIcon/LabeledIcon.js +1 -1
- package/LabeledIcon/tests/LabeledIcon-specs.js +4 -4
- package/Layout/tests/Layout-specs.js +10 -10
- package/Marquee/MarqueeController.js +1 -1
- package/Marquee/tests/Marquee-specs.js +44 -44
- package/Measurable/tests/Measurable-specs.js +3 -3
- package/Media/Media.js +1 -1
- package/Media/tests/Media-specs.js +12 -12
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +1 -1
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/ProgressBar/tests/ProgressBar-specs.js +7 -7
- package/Repeater/tests/Repeater-specs.js +14 -14
- package/Resizable/tests/Resizable-specs.js +1 -1
- package/Resizable/tests/useResize-specs.js +1 -1
- package/Routable/tests/Routable-specs.js +1 -1
- package/Routable/tests/Router-specs.js +10 -10
- package/Routable/util.js +3 -3
- package/Scroller/tests/Scroller-specs.js +3 -3
- package/Skinnable/Skinnable.js +1 -1
- package/Skinnable/tests/Skinnable-specs.js +19 -19
- package/Skinnable/tests/useSkins-specs.js +14 -14
- package/Slider/tests/Slider-specs.js +7 -7
- package/Slottable/tests/Slottable-specs.js +10 -10
- package/Slottable/tests/useSlots-specs.js +10 -10
- package/Spinner/tests/Spinner-specs.js +5 -5
- package/ToggleIcon/tests/ToggleIcon-specs.js +5 -5
- package/Toggleable/tests/Toggleable-specs.js +41 -41
- package/Touchable/tests/Touchable-specs.js +36 -36
- package/Touchable/tests/useTouch-specs.js +15 -15
- package/Transition/tests/Transition-specs.js +11 -11
- package/ViewManager/tests/View-specs.js +13 -13
- package/ViewManager/tests/ViewManager-specs.js +50 -50
- package/VirtualList/VirtualListBasic.js +1 -1
- package/VirtualList/tests/VirtualGridList-native-specs.js +6 -6
- package/VirtualList/tests/VirtualGridList-specs.js +23 -23
- package/VirtualList/tests/VirtualList-native-specs.js +7 -7
- package/VirtualList/tests/VirtualList-specs.js +29 -29
- package/internal/IdProvider/tests/IdProvider-specs.js +2 -2
- package/internal/IdProvider/tests/useId-specs.js +6 -6
- package/internal/Pure/tests/Pure-specs.js +5 -5
- package/package.json +6 -6
- package/resolution/tests/ResolutionDecorator-specs.js +2 -2
- package/styles/mixins.less +0 -2
- package/useControlledState/tests/useControlledState-specs.js +10 -10
- package/useScroll/ScrollAnimator.js +3 -3
- package/useScroll/useScroll.js +3 -0
|
@@ -7,7 +7,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
7
7
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
8
8
|
describe('Scrim Specs', function () {
|
|
9
9
|
test('should be translucent by default', function () {
|
|
10
|
-
(0, _react.render)(
|
|
10
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scrim["default"], {
|
|
11
11
|
"data-testid": "scrim"
|
|
12
12
|
}));
|
|
13
13
|
var expected = 'translucent';
|
|
@@ -15,7 +15,7 @@ describe('Scrim Specs', function () {
|
|
|
15
15
|
expect(scrimContainer).toHaveClass(expected);
|
|
16
16
|
});
|
|
17
17
|
test('should only render 1 translucent scrim at a time', function () {
|
|
18
|
-
(0, _react.render)(
|
|
18
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
19
19
|
"data-testid": "rootElement",
|
|
20
20
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scrim["default"], {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Scrim["default"], {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Scrim["default"], {})]
|
|
21
21
|
}));
|
|
@@ -13,10 +13,10 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
13
13
|
describe('FloatingLayer Specs', function () {
|
|
14
14
|
function Root(props) {
|
|
15
15
|
var hook = (0, _FloatingLayerDecorator.useFloatingLayerDecorator)();
|
|
16
|
-
return hook.provideFloatingLayer(
|
|
16
|
+
return hook.provideFloatingLayer(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props), "floatWrapped"));
|
|
17
17
|
}
|
|
18
18
|
test('should not render if FloatingLayer is not open', function () {
|
|
19
|
-
(0, _react.render)(
|
|
19
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
20
20
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
21
21
|
"data-testid": "floatingLayer",
|
|
22
22
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -28,7 +28,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
28
28
|
expect(floatingLayerContainer).not.toBeInTheDocument();
|
|
29
29
|
});
|
|
30
30
|
test('should render if FloatingLayer is open', function () {
|
|
31
|
-
(0, _react.render)(
|
|
31
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
33
33
|
"data-testid": "floatingLayer",
|
|
34
34
|
open: true,
|
|
@@ -15,7 +15,7 @@ describe('Group', function () {
|
|
|
15
15
|
test('should call handler with selected on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
16
16
|
var handleClick = jest.fn();
|
|
17
17
|
var user = _userEvent["default"].setup();
|
|
18
|
-
(0, _react.render)(
|
|
18
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
19
19
|
childComponent: "div",
|
|
20
20
|
onSelect: handleClick,
|
|
21
21
|
children: stringItems
|
|
@@ -29,7 +29,7 @@ describe('Group', function () {
|
|
|
29
29
|
test('should call handler with data on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
30
30
|
var handleClick = jest.fn();
|
|
31
31
|
var user = _userEvent["default"].setup();
|
|
32
|
-
(0, _react.render)(
|
|
32
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
33
33
|
childComponent: "div",
|
|
34
34
|
onSelect: handleClick,
|
|
35
35
|
children: stringItems
|
|
@@ -43,7 +43,7 @@ describe('Group', function () {
|
|
|
43
43
|
test('should call handler with data on select stored in the key specified by `selectedEventProp`', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
44
44
|
var handleClick = jest.fn();
|
|
45
45
|
var user = _userEvent["default"].setup();
|
|
46
|
-
(0, _react.render)(
|
|
46
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
47
47
|
childComponent: "div",
|
|
48
48
|
onSelect: handleClick,
|
|
49
49
|
selectedEventProp: "value",
|
|
@@ -57,7 +57,7 @@ describe('Group', function () {
|
|
|
57
57
|
}));
|
|
58
58
|
test('should call handler on move when childSelect="onMouseMove"', function () {
|
|
59
59
|
var handleClick = jest.fn();
|
|
60
|
-
(0, _react.render)(
|
|
60
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
61
61
|
childComponent: "div",
|
|
62
62
|
childSelect: "onMouseMove",
|
|
63
63
|
onSelect: handleClick,
|
|
@@ -72,7 +72,7 @@ describe('Group', function () {
|
|
|
72
72
|
test('should select the third item with selected=2', function () {
|
|
73
73
|
var selected = 2;
|
|
74
74
|
var handleClick = jest.fn();
|
|
75
|
-
(0, _react.render)(
|
|
75
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
76
76
|
childComponent: "div",
|
|
77
77
|
onSelect: handleClick,
|
|
78
78
|
selected: selected,
|
|
@@ -85,7 +85,7 @@ describe('Group', function () {
|
|
|
85
85
|
test('should set {data-active} on the first item', function () {
|
|
86
86
|
var selected = 0;
|
|
87
87
|
var handleClick = jest.fn();
|
|
88
|
-
(0, _react.render)(
|
|
88
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
89
89
|
childComponent: "div",
|
|
90
90
|
onSelect: handleClick,
|
|
91
91
|
selected: selected,
|
|
@@ -99,7 +99,7 @@ describe('Group', function () {
|
|
|
99
99
|
test('should set {children} to be the item by default', function () {
|
|
100
100
|
var selected = 0;
|
|
101
101
|
var handleClick = jest.fn();
|
|
102
|
-
(0, _react.render)(
|
|
102
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
103
103
|
childComponent: "div",
|
|
104
104
|
onSelect: handleClick,
|
|
105
105
|
children: stringItems
|
|
@@ -111,7 +111,7 @@ describe('Group', function () {
|
|
|
111
111
|
test('should set {data-child} to be the item', function () {
|
|
112
112
|
var selected = 0;
|
|
113
113
|
var handleClick = jest.fn();
|
|
114
|
-
(0, _react.render)(
|
|
114
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
115
115
|
childComponent: "div",
|
|
116
116
|
childProp: "data-child",
|
|
117
117
|
onSelect: handleClick,
|
|
@@ -122,7 +122,7 @@ describe('Group', function () {
|
|
|
122
122
|
expect(actual).toHaveAttribute('data-child', expected);
|
|
123
123
|
});
|
|
124
124
|
test('should set aria-multiselectable when select="multiple"', function () {
|
|
125
|
-
(0, _react.render)(
|
|
125
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
126
126
|
childComponent: "div",
|
|
127
127
|
select: "multiple",
|
|
128
128
|
children: stringItems
|
|
@@ -132,7 +132,7 @@ describe('Group', function () {
|
|
|
132
132
|
expect(actual).toHaveAttribute('aria-multiselectable', expected);
|
|
133
133
|
});
|
|
134
134
|
test('should set role to group', function () {
|
|
135
|
-
(0, _react.render)(
|
|
135
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
136
136
|
childComponent: "div",
|
|
137
137
|
select: "multiple",
|
|
138
138
|
children: stringItems
|
|
@@ -142,7 +142,7 @@ describe('Group', function () {
|
|
|
142
142
|
});
|
|
143
143
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
144
144
|
var ref = jest.fn();
|
|
145
|
-
(0, _react.render)(
|
|
145
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Group["default"], {
|
|
146
146
|
childComponent: "div",
|
|
147
147
|
ref: ref,
|
|
148
148
|
children: stringItems
|
|
@@ -8,14 +8,14 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
8
8
|
describe('Heading Specs', function () {
|
|
9
9
|
test('should render a Heading with content', function () {
|
|
10
10
|
var content = 'Hello Heading!';
|
|
11
|
-
(0, _react.render)(
|
|
11
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
12
12
|
children: content
|
|
13
13
|
}));
|
|
14
14
|
var actual = _react.screen.getByText('Hello Heading!');
|
|
15
15
|
expect(actual).toBeInTheDocument();
|
|
16
16
|
});
|
|
17
17
|
test('should have medium class by default', function () {
|
|
18
|
-
(0, _react.render)(
|
|
18
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
19
19
|
children: "Heading Text"
|
|
20
20
|
}));
|
|
21
21
|
var expected = 'medium';
|
|
@@ -23,7 +23,7 @@ describe('Heading Specs', function () {
|
|
|
23
23
|
expect(actual).toHaveClass(expected);
|
|
24
24
|
});
|
|
25
25
|
test('should have title class if `size` is title', function () {
|
|
26
|
-
(0, _react.render)(
|
|
26
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
27
27
|
size: "title",
|
|
28
28
|
children: "Heading Text"
|
|
29
29
|
}));
|
|
@@ -32,7 +32,7 @@ describe('Heading Specs', function () {
|
|
|
32
32
|
expect(actual).toHaveClass(expected);
|
|
33
33
|
});
|
|
34
34
|
test('should have subtitle class if `size` is subtitle', function () {
|
|
35
|
-
(0, _react.render)(
|
|
35
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
36
36
|
size: "subtitle",
|
|
37
37
|
children: "Heading Text"
|
|
38
38
|
}));
|
|
@@ -41,7 +41,7 @@ describe('Heading Specs', function () {
|
|
|
41
41
|
expect(actual).toHaveClass(expected);
|
|
42
42
|
});
|
|
43
43
|
test('should have large class if `size` is large', function () {
|
|
44
|
-
(0, _react.render)(
|
|
44
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
45
45
|
size: "large",
|
|
46
46
|
children: "Heading Text"
|
|
47
47
|
}));
|
|
@@ -50,7 +50,7 @@ describe('Heading Specs', function () {
|
|
|
50
50
|
expect(actual).toHaveClass(expected);
|
|
51
51
|
});
|
|
52
52
|
test('should have small class if `size` is small', function () {
|
|
53
|
-
(0, _react.render)(
|
|
53
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
54
54
|
size: "small",
|
|
55
55
|
children: "Heading Text"
|
|
56
56
|
}));
|
|
@@ -59,7 +59,7 @@ describe('Heading Specs', function () {
|
|
|
59
59
|
expect(actual).toHaveClass(expected);
|
|
60
60
|
});
|
|
61
61
|
test('should have tiny class if `size` is tiny', function () {
|
|
62
|
-
(0, _react.render)(
|
|
62
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
63
63
|
size: "tiny",
|
|
64
64
|
children: "Heading Text"
|
|
65
65
|
}));
|
|
@@ -68,7 +68,7 @@ describe('Heading Specs', function () {
|
|
|
68
68
|
expect(actual).toHaveClass(expected);
|
|
69
69
|
});
|
|
70
70
|
test('should apply a matching spacing class to its defined size', function () {
|
|
71
|
-
(0, _react.render)(
|
|
71
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
72
72
|
size: "large",
|
|
73
73
|
children: "Heading Text"
|
|
74
74
|
}));
|
|
@@ -77,7 +77,7 @@ describe('Heading Specs', function () {
|
|
|
77
77
|
expect(actual).toHaveClass(expected);
|
|
78
78
|
});
|
|
79
79
|
test('should apply an alternate spacing class to its defined size if the two differ', function () {
|
|
80
|
-
(0, _react.render)(
|
|
80
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
81
81
|
size: "large",
|
|
82
82
|
spacing: "small",
|
|
83
83
|
children: "Heading Text"
|
|
@@ -87,7 +87,7 @@ describe('Heading Specs', function () {
|
|
|
87
87
|
expect(actual).toHaveClass(expected);
|
|
88
88
|
});
|
|
89
89
|
test('should have largeSpacing class if `spacing` is large', function () {
|
|
90
|
-
(0, _react.render)(
|
|
90
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
91
91
|
spacing: "large",
|
|
92
92
|
children: "Heading Text"
|
|
93
93
|
}));
|
|
@@ -96,7 +96,7 @@ describe('Heading Specs', function () {
|
|
|
96
96
|
expect(actual).toHaveClass(expected);
|
|
97
97
|
});
|
|
98
98
|
test('should have mediumSpacing class if `spacing` is medium', function () {
|
|
99
|
-
(0, _react.render)(
|
|
99
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
100
100
|
spacing: "medium",
|
|
101
101
|
children: "Heading Text"
|
|
102
102
|
}));
|
|
@@ -105,7 +105,7 @@ describe('Heading Specs', function () {
|
|
|
105
105
|
expect(actual).toHaveClass(expected);
|
|
106
106
|
});
|
|
107
107
|
test('should have smallSpacing class if `spacing` is small', function () {
|
|
108
|
-
(0, _react.render)(
|
|
108
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
109
109
|
spacing: "small",
|
|
110
110
|
children: "Heading Text"
|
|
111
111
|
}));
|
|
@@ -114,7 +114,7 @@ describe('Heading Specs', function () {
|
|
|
114
114
|
expect(actual).toHaveClass(expected);
|
|
115
115
|
});
|
|
116
116
|
test('should have noneSpacing class if `spacing` is none', function () {
|
|
117
|
-
(0, _react.render)(
|
|
117
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
118
118
|
spacing: "none",
|
|
119
119
|
children: "Heading Text"
|
|
120
120
|
}));
|
|
@@ -124,7 +124,7 @@ describe('Heading Specs', function () {
|
|
|
124
124
|
});
|
|
125
125
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
126
126
|
var ref = jest.fn();
|
|
127
|
-
(0, _react.render)(
|
|
127
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], {
|
|
128
128
|
size: "large",
|
|
129
129
|
ref: ref
|
|
130
130
|
}));
|
package/Icon/tests/Icon-specs.js
CHANGED
|
@@ -9,7 +9,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
9
9
|
describe('Icon', function () {
|
|
10
10
|
test('should allow icon-name words to pass through', function () {
|
|
11
11
|
var iconName = 'hollow_star';
|
|
12
|
-
(0, _react.render)(
|
|
12
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
13
13
|
"data-testid": "icon",
|
|
14
14
|
children: iconName
|
|
15
15
|
}));
|
|
@@ -18,7 +18,7 @@ describe('Icon', function () {
|
|
|
18
18
|
});
|
|
19
19
|
test('should allow single-byte characters to pass through', function () {
|
|
20
20
|
var iconName = '+';
|
|
21
|
-
(0, _react.render)(
|
|
21
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
22
22
|
"data-testid": "icon",
|
|
23
23
|
children: iconName
|
|
24
24
|
}));
|
|
@@ -27,7 +27,7 @@ describe('Icon', function () {
|
|
|
27
27
|
});
|
|
28
28
|
test('should allow multi-byte characters to pass through', function () {
|
|
29
29
|
var iconName = '';
|
|
30
|
-
(0, _react.render)(
|
|
30
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
31
31
|
"data-testid": "icon",
|
|
32
32
|
children: iconName
|
|
33
33
|
}));
|
|
@@ -41,7 +41,7 @@ describe('Icon', function () {
|
|
|
41
41
|
train: 'T',
|
|
42
42
|
factory: 'F'
|
|
43
43
|
};
|
|
44
|
-
(0, _react.render)(
|
|
44
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
45
45
|
"data-testid": "icon",
|
|
46
46
|
iconList: iconList,
|
|
47
47
|
children: iconName
|
|
@@ -55,7 +55,7 @@ describe('Icon', function () {
|
|
|
55
55
|
train: 'T',
|
|
56
56
|
factory: 'F'
|
|
57
57
|
};
|
|
58
|
-
(0, _react.render)(
|
|
58
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
59
59
|
"data-testid": "icon",
|
|
60
60
|
iconList: iconList,
|
|
61
61
|
children: iconName
|
|
@@ -65,7 +65,7 @@ describe('Icon', function () {
|
|
|
65
65
|
});
|
|
66
66
|
test('should allow URIs to be used as an icon', function () {
|
|
67
67
|
var src = 'images/icon.png';
|
|
68
|
-
(0, _react.render)(
|
|
68
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
69
69
|
"data-testid": "icon",
|
|
70
70
|
children: src
|
|
71
71
|
}));
|
|
@@ -77,7 +77,7 @@ describe('Icon', function () {
|
|
|
77
77
|
});
|
|
78
78
|
test('should allow URLs to be used as an icon', function () {
|
|
79
79
|
var src = 'http://enactjs.com/images/logo';
|
|
80
|
-
(0, _react.render)(
|
|
80
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
81
81
|
"data-testid": "icon",
|
|
82
82
|
children: src
|
|
83
83
|
}));
|
|
@@ -89,7 +89,7 @@ describe('Icon', function () {
|
|
|
89
89
|
});
|
|
90
90
|
test('should merge author styles with image URLs', function () {
|
|
91
91
|
var src = 'images/icon.png';
|
|
92
|
-
(0, _react.render)(
|
|
92
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
|
|
93
93
|
"data-testid": "icon",
|
|
94
94
|
style: {
|
|
95
95
|
color: 'green'
|
|
@@ -105,7 +105,7 @@ describe('Icon', function () {
|
|
|
105
105
|
});
|
|
106
106
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
107
107
|
var ref = jest.fn();
|
|
108
|
-
(0, _react.render)(
|
|
108
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon["default"], {
|
|
109
109
|
ref: ref
|
|
110
110
|
}));
|
|
111
111
|
var expected = 'DIV';
|
|
@@ -13,7 +13,7 @@ var src = {
|
|
|
13
13
|
};
|
|
14
14
|
describe('Image Specs', function () {
|
|
15
15
|
test('should only have image class without sizing', function () {
|
|
16
|
-
(0, _react.render)(
|
|
16
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageBase, {
|
|
17
17
|
"data-testid": "image",
|
|
18
18
|
sizing: "none",
|
|
19
19
|
src: src
|
|
@@ -23,7 +23,7 @@ describe('Image Specs', function () {
|
|
|
23
23
|
expect(imageElement).toHaveClass(expected);
|
|
24
24
|
});
|
|
25
25
|
test('should have class for fill', function () {
|
|
26
|
-
(0, _react.render)(
|
|
26
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageBase, {
|
|
27
27
|
"data-testid": "image",
|
|
28
28
|
sizing: "fill",
|
|
29
29
|
src: src
|
|
@@ -33,7 +33,7 @@ describe('Image Specs', function () {
|
|
|
33
33
|
expect(imageElement).toHaveClass(expected);
|
|
34
34
|
});
|
|
35
35
|
test('should have class for fit', function () {
|
|
36
|
-
(0, _react.render)(
|
|
36
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageBase, {
|
|
37
37
|
"data-testid": "image",
|
|
38
38
|
sizing: "fit",
|
|
39
39
|
src: src
|
|
@@ -43,7 +43,7 @@ describe('Image Specs', function () {
|
|
|
43
43
|
expect(imageElement).toHaveClass(expected);
|
|
44
44
|
});
|
|
45
45
|
test('should set role to img by default', function () {
|
|
46
|
-
(0, _react.render)(
|
|
46
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageBase, {
|
|
47
47
|
"data-testid": "image",
|
|
48
48
|
sizing: "fit",
|
|
49
49
|
src: src
|
|
@@ -54,7 +54,7 @@ describe('Image Specs', function () {
|
|
|
54
54
|
});
|
|
55
55
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
56
56
|
var ref = jest.fn();
|
|
57
|
-
(0, _react.render)(
|
|
57
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image["default"], {
|
|
58
58
|
ref: ref,
|
|
59
59
|
src: src
|
|
60
60
|
}));
|
|
@@ -24,7 +24,7 @@ describe('ImageItem', function () {
|
|
|
24
24
|
};
|
|
25
25
|
test('should support `children` prop', function () {
|
|
26
26
|
var children = 'children';
|
|
27
|
-
(0, _react.render)(
|
|
27
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
28
28
|
"data-testid": "imageItem",
|
|
29
29
|
src: src.hd,
|
|
30
30
|
children: children
|
|
@@ -34,7 +34,7 @@ describe('ImageItem', function () {
|
|
|
34
34
|
expect(imageItem).toHaveTextContent(expected);
|
|
35
35
|
});
|
|
36
36
|
test('should omit caption node when `children` is unset', function () {
|
|
37
|
-
(0, _react.render)(
|
|
37
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
38
38
|
"data-testid": "imageItem",
|
|
39
39
|
src: src
|
|
40
40
|
}));
|
|
@@ -43,7 +43,7 @@ describe('ImageItem', function () {
|
|
|
43
43
|
expect(imageItemChildren).toHaveLength(expected);
|
|
44
44
|
});
|
|
45
45
|
test('should apply `.horizontal` when `orientation="horizontal"`', function () {
|
|
46
|
-
(0, _react.render)(
|
|
46
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem["default"], {
|
|
47
47
|
"data-testid": "imageItem",
|
|
48
48
|
orientation: "horizontal",
|
|
49
49
|
src: src
|
|
@@ -53,7 +53,7 @@ describe('ImageItem', function () {
|
|
|
53
53
|
expect(imageItem).toHaveClass(expected);
|
|
54
54
|
});
|
|
55
55
|
test('should apply `.vertical` when `orientation="vertical"`', function () {
|
|
56
|
-
(0, _react.render)(
|
|
56
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
57
57
|
"data-testid": "imageItem",
|
|
58
58
|
orientation: "vertical",
|
|
59
59
|
src: src
|
|
@@ -63,7 +63,7 @@ describe('ImageItem', function () {
|
|
|
63
63
|
expect(imageItem).toHaveClass(expected);
|
|
64
64
|
});
|
|
65
65
|
test('should apply `.selected` when `selected`', function () {
|
|
66
|
-
(0, _react.render)(
|
|
66
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
67
67
|
"data-testid": "imageItem",
|
|
68
68
|
selected: true,
|
|
69
69
|
src: src
|
|
@@ -77,7 +77,7 @@ describe('ImageItem', function () {
|
|
|
77
77
|
src: 'img.png',
|
|
78
78
|
placeholder: 'place.png'
|
|
79
79
|
};
|
|
80
|
-
(0, _react.render)(
|
|
80
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, _objectSpread({
|
|
81
81
|
imageComponent: Img
|
|
82
82
|
}, props)));
|
|
83
83
|
expect(data).toMatchObject(props);
|
|
@@ -87,7 +87,7 @@ describe('ImageItem', function () {
|
|
|
87
87
|
src: 'img.png',
|
|
88
88
|
placeholder: 'place.png'
|
|
89
89
|
};
|
|
90
|
-
(0, _react.render)(
|
|
90
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, _objectSpread({
|
|
91
91
|
imageComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(Img, {})
|
|
92
92
|
}, props)));
|
|
93
93
|
expect(data).toMatchObject(props);
|
|
@@ -97,7 +97,7 @@ describe('ImageItem', function () {
|
|
|
97
97
|
src: 'img.png',
|
|
98
98
|
placeholder: 'place.png'
|
|
99
99
|
};
|
|
100
|
-
(0, _react.render)(
|
|
100
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, _objectSpread({
|
|
101
101
|
imageComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(Img, {
|
|
102
102
|
placeholder: "my-place.png",
|
|
103
103
|
src: "my-src.png"
|
|
@@ -106,7 +106,7 @@ describe('ImageItem', function () {
|
|
|
106
106
|
expect(data).toMatchObject(props);
|
|
107
107
|
});
|
|
108
108
|
test('should support string for `src` prop', function () {
|
|
109
|
-
(0, _react.render)(
|
|
109
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
110
110
|
src: src.hd
|
|
111
111
|
}));
|
|
112
112
|
var expected = src.hd;
|
|
@@ -114,7 +114,7 @@ describe('ImageItem', function () {
|
|
|
114
114
|
expect(imgElement).toHaveAttribute('src', expected);
|
|
115
115
|
});
|
|
116
116
|
test('should support object for `src` prop', function () {
|
|
117
|
-
(0, _react.render)(
|
|
117
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
|
|
118
118
|
src: src
|
|
119
119
|
}));
|
|
120
120
|
var imgElementSrc = _react.screen.getAllByRole('img')[1];
|
|
@@ -122,7 +122,7 @@ describe('ImageItem', function () {
|
|
|
122
122
|
});
|
|
123
123
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
124
124
|
var ref = jest.fn();
|
|
125
|
-
(0, _react.render)(
|
|
125
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem["default"], {
|
|
126
126
|
ref: ref,
|
|
127
127
|
src: src
|
|
128
128
|
}));
|
package/Item/tests/Item-specs.js
CHANGED
|
@@ -14,14 +14,14 @@ var tap = function tap(node) {
|
|
|
14
14
|
};
|
|
15
15
|
describe('Item', function () {
|
|
16
16
|
test('should render an item', function () {
|
|
17
|
-
(0, _react.render)(
|
|
17
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
18
18
|
children: "I am an item"
|
|
19
19
|
}));
|
|
20
20
|
var actual = _react.screen.getByText('I am an item');
|
|
21
21
|
expect(actual).toBeInTheDocument();
|
|
22
22
|
});
|
|
23
23
|
test('should render a disabled item', function () {
|
|
24
|
-
(0, _react.render)(
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
25
25
|
disabled: true,
|
|
26
26
|
children: "I am a disabled item"
|
|
27
27
|
}));
|
|
@@ -29,7 +29,7 @@ describe('Item', function () {
|
|
|
29
29
|
expect(actual).toHaveAttribute('disabled');
|
|
30
30
|
});
|
|
31
31
|
test('should render an inline item', function () {
|
|
32
|
-
(0, _react.render)(
|
|
32
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
33
33
|
inline: true,
|
|
34
34
|
children: "I am an inline item"
|
|
35
35
|
}));
|
|
@@ -40,7 +40,7 @@ describe('Item', function () {
|
|
|
40
40
|
describe('events', function () {
|
|
41
41
|
test('should call onTap when tapped', function () {
|
|
42
42
|
var handleClick = jest.fn();
|
|
43
|
-
(0, _react.render)(
|
|
43
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
44
44
|
onTap: handleClick,
|
|
45
45
|
children: "I am a normal item"
|
|
46
46
|
}));
|
|
@@ -51,7 +51,7 @@ describe('Item', function () {
|
|
|
51
51
|
});
|
|
52
52
|
test('should not call onTap when tapped and disabled', function () {
|
|
53
53
|
var handleClick = jest.fn();
|
|
54
|
-
(0, _react.render)(
|
|
54
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
55
55
|
disabled: true,
|
|
56
56
|
onTap: handleClick,
|
|
57
57
|
children: "I am a disabled item"
|
|
@@ -63,7 +63,7 @@ describe('Item', function () {
|
|
|
63
63
|
test('should call onClick when clicked', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
64
64
|
var handleClick = jest.fn();
|
|
65
65
|
var user = _userEvent["default"].setup();
|
|
66
|
-
(0, _react.render)(
|
|
66
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
67
67
|
onClick: handleClick,
|
|
68
68
|
children: "I am a normal Item"
|
|
69
69
|
}));
|
|
@@ -75,7 +75,7 @@ describe('Item', function () {
|
|
|
75
75
|
test('should not call onClick when clicked and disabled', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
76
76
|
var handleClick = jest.fn();
|
|
77
77
|
var user = _userEvent["default"].setup();
|
|
78
|
-
(0, _react.render)(
|
|
78
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
79
79
|
disabled: true,
|
|
80
80
|
onClick: handleClick,
|
|
81
81
|
children: "I am a disabled Item"
|
|
@@ -204,7 +204,7 @@ var LabeledIconBase = exports.LabeledIconBase = (0, _kind["default"])({
|
|
|
204
204
|
// `icon` is normally passed to `iconComponent` as children, but if `icon` is instead a
|
|
205
205
|
// rendered JSX component, it should become a child of `Cell.icon` and iconComponent should
|
|
206
206
|
// use Cell's default value. We must also reposition the `icon` class
|
|
207
|
-
if (
|
|
207
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(icon)) {
|
|
208
208
|
icon = (0, _ComponentOverride["default"])({
|
|
209
209
|
component: icon,
|
|
210
210
|
className: iconClassName,
|
|
@@ -19,7 +19,7 @@ var iconComponent = function iconComponent(_ref) {
|
|
|
19
19
|
};
|
|
20
20
|
describe('LabeledIcon Specs', function () {
|
|
21
21
|
test('should insert the icon source into the icon when using the prop approach', function () {
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
|
|
23
23
|
icon: iconName,
|
|
24
24
|
iconComponent: iconComponent,
|
|
25
25
|
children: iconLabel
|
|
@@ -30,7 +30,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
30
30
|
expect(icon.textContent).toBe(expected);
|
|
31
31
|
});
|
|
32
32
|
test('should insert the icon source into the icon slot element', function () {
|
|
33
|
-
(0, _react.render)(
|
|
33
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_LabeledIcon["default"], {
|
|
34
34
|
iconComponent: iconComponent,
|
|
35
35
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("icon", {
|
|
36
36
|
children: iconName
|
|
@@ -42,7 +42,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
42
42
|
expect(icon.textContent).toBe(expected);
|
|
43
43
|
});
|
|
44
44
|
test('should insert custom icon components into the icon slot', function () {
|
|
45
|
-
(0, _react.render)(
|
|
45
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_LabeledIcon["default"], {
|
|
46
46
|
iconComponent: iconComponent,
|
|
47
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("icon", {
|
|
48
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon["default"], {
|
|
@@ -56,7 +56,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
56
56
|
});
|
|
57
57
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
58
58
|
var ref = jest.fn();
|
|
59
|
-
(0, _react.render)(
|
|
59
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
|
|
60
60
|
icon: iconName,
|
|
61
61
|
iconComponent: iconComponent,
|
|
62
62
|
ref: ref
|