@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.
- package/AnnounceDecorator/tests/Announce-specs.js +13 -5
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +9 -7
- package/AnnounceDecorator/tests/useAnnounce-specs.js +25 -17
- package/BodyText/BodyText.d.ts +1 -1
- package/BodyText/tests/BodyText-specs.js +49 -35
- package/Button/Button.d.ts +6 -6
- package/Button/Button.js +5 -3
- package/Button/tests/Button-specs.js +104 -3
- package/CHANGELOG.md +26 -0
- package/Cancelable/Cancelable.js +1 -1
- package/Cancelable/tests/Cancelable-specs.js +131 -70
- package/Changeable/tests/Changeable-specs.js +162 -110
- package/FloatingLayer/FloatingLayer.js +5 -17
- package/FloatingLayer/tests/FloatingLayer-specs.js +83 -8
- package/FloatingLayer/tests/Scrim-specs.js +20 -11
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +15 -9
- package/GridListImageItem/GridListImageItem.d.ts +1 -1
- package/Group/Group.d.ts +2 -2
- package/Group/tests/Group-specs.js +71 -41
- package/Heading/Heading.d.ts +2 -1
- package/Heading/tests/Heading-specs.js +27 -20
- package/Icon/Icon.d.ts +4 -4
- package/Icon/tests/Icon-specs.js +52 -31
- package/IconButton/IconButton.d.ts +4 -4
- package/IconButton/tests/IconButton-specs.js +2 -2
- package/Image/tests/Image-specs.js +39 -29
- package/ImageItem/tests/ImageItem-specs.js +71 -68
- package/Item/tests/Item-specs.js +59 -35
- package/LabeledIcon/LabeledIcon.d.ts +4 -4
- package/LabeledIcon/tests/LabeledIcon-specs.js +30 -19
- package/Layout/Layout.d.ts +16 -16
- package/Layout/tests/Layout-specs.js +37 -25
- package/Marquee/MarqueeBase.js +1 -5
- package/Marquee/MarqueeDecorator.js +6 -3
- package/Marquee/index.d.ts +4 -1
- package/Marquee/tests/Marquee-specs.js +242 -116
- package/Media/Media.js +1 -3
- package/ProgressBar/tests/ProgressBar-specs.js +60 -42
- package/README.md +1 -1
- package/RadioDecorator/RadioDecorator.js +3 -5
- package/RadioDecorator/tests/RadioDecorator-specs.js +179 -65
- package/Repeater/Repeater.d.ts +2 -1
- package/Repeater/tests/Repeater-specs.js +86 -45
- package/Routable/Routable.d.ts +2 -2
- package/Routable/tests/Routable-specs.js +26 -17
- package/Routable/tests/Router-specs.js +65 -41
- package/Scrollable/Scrollable.js +2 -1
- package/Scrollable/ScrollableNative.js +2 -1
- package/Scroller/Scroller.d.ts +2 -14
- package/Scroller/ScrollerBasic.js +10 -29
- package/Scroller/UiScrollerBase.js +1 -1
- package/Skinnable/tests/Skinnable-specs.js +102 -54
- package/Skinnable/tests/useSkins-specs.js +37 -42
- package/Slider/Slider.d.ts +3 -3
- package/Slider/tests/Slider-specs.js +4 -4
- package/SlotItem/SlotItem.d.ts +2 -2
- package/SlotItem/tests/SlotItem-specs.js +4 -4
- package/Slottable/tests/Slottable-specs.js +67 -36
- package/Slottable/tests/useSlots-specs.js +68 -35
- package/Spinner/Spinner.d.ts +1 -1
- package/Spinner/tests/Spinner-specs.js +46 -31
- package/ToggleIcon/tests/ToggleIcon-specs.js +32 -20
- package/ToggleItem/ToggleItem.d.ts +13 -11
- package/ToggleItem/tests/ToggleItem-specs.js +51 -34
- package/Toggleable/Toggle.js +6 -6
- package/Toggleable/Toggleable.js +6 -12
- package/Toggleable/tests/Toggleable-specs.js +428 -324
- package/Touchable/Drag.js +13 -17
- package/Touchable/Flick.js +20 -16
- package/Touchable/Hold.js +14 -19
- package/Touchable/Touchable.d.ts +3 -3
- package/Touchable/tests/Touchable-specs.js +223 -109
- package/Touchable/tests/useTouch-specs.js +159 -84
- package/Transition/Transition.d.ts +29 -27
- package/Transition/Transition.js +11 -9
- package/Transition/tests/Transition-specs.js +111 -31
- package/ViewManager/TransitionGroup.js +6 -5
- package/ViewManager/View.js +1 -1
- package/ViewManager/ViewManager.d.ts +4 -4
- package/ViewManager/ViewManager.js +10 -10
- package/ViewManager/tests/View-specs.js +109 -81
- package/ViewManager/tests/ViewManager-specs.js +471 -185
- package/VirtualList/UiVirtualListBase.js +11 -21
- package/VirtualList/VirtualList.d.ts +11 -29
- package/VirtualList/VirtualListBasic.js +33 -49
- package/VirtualList/tests/VirtualList-specs.js +29 -61
- package/internal/IdProvider/tests/useId-specs.js +35 -18
- package/package.json +11 -11
- package/resolution/tests/ResolutionDecorator-specs.js +17 -8
- package/styles/mixins.less +14 -2
- package/useControlledState/tests/useControlledState-specs.js +67 -42
- package/useScroll/useScroll.js +12 -26
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require("@testing-library/jest-dom");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _react = require("@testing-library/react");
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _index = require("../index.js");
|
|
8
8
|
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
11
|
var ltrText = 'This is some fine latin text.',
|
|
14
|
-
rtlText = 'العربية - العراق'
|
|
15
|
-
contentSelector = ".".concat(_MarqueeModule["default"].text);
|
|
12
|
+
rtlText = 'العربية - العراق';
|
|
16
13
|
describe('Marquee', function () {
|
|
17
14
|
beforeEach(function () {
|
|
18
15
|
global.Element.prototype.getBoundingClientRect = jest.fn(function () {
|
|
@@ -27,116 +24,186 @@ describe('Marquee', function () {
|
|
|
27
24
|
});
|
|
28
25
|
});
|
|
29
26
|
test('should determine the correct directionality of latin text on initial render', function () {
|
|
30
|
-
|
|
27
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
31
28
|
children: ltrText
|
|
32
29
|
}));
|
|
30
|
+
|
|
31
|
+
var marquee = _react.screen.getByText(ltrText);
|
|
32
|
+
|
|
33
33
|
var expected = 'ltr';
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
expect(marquee).toHaveStyle({
|
|
35
|
+
'direction': expected
|
|
36
|
+
});
|
|
36
37
|
});
|
|
37
38
|
test('should determine the correct directionality of non-latin text on initial render', function () {
|
|
38
|
-
|
|
39
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
39
40
|
children: rtlText
|
|
40
41
|
}));
|
|
42
|
+
|
|
43
|
+
var marquee = _react.screen.getByText(rtlText);
|
|
44
|
+
|
|
41
45
|
var expected = 'rtl';
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
expect(marquee).toHaveStyle({
|
|
47
|
+
'direction': expected
|
|
48
|
+
});
|
|
44
49
|
});
|
|
45
50
|
test('should force the directionality text if forceDirection is specified', function () {
|
|
46
|
-
|
|
51
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
47
52
|
forceDirection: "ltr",
|
|
48
53
|
children: rtlText
|
|
49
54
|
}));
|
|
55
|
+
|
|
56
|
+
var marquee = _react.screen.getByText(rtlText);
|
|
57
|
+
|
|
50
58
|
var expected = 'ltr';
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
expect(marquee).toHaveStyle({
|
|
60
|
+
'direction': expected
|
|
61
|
+
});
|
|
53
62
|
});
|
|
54
63
|
test('should switch directionality when the text content changes after initial render', function () {
|
|
55
|
-
var
|
|
64
|
+
var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
56
65
|
children: ltrText
|
|
57
|
-
}))
|
|
58
|
-
|
|
66
|
+
})),
|
|
67
|
+
rerender = _render.rerender;
|
|
68
|
+
|
|
69
|
+
var marquee = _react.screen.getByText(ltrText);
|
|
70
|
+
|
|
71
|
+
rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
59
72
|
children: rtlText
|
|
60
|
-
});
|
|
61
|
-
subject.update();
|
|
73
|
+
}));
|
|
62
74
|
var expected = 'rtl';
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
expect(marquee).toHaveStyle({
|
|
76
|
+
'direction': expected
|
|
77
|
+
});
|
|
65
78
|
});
|
|
66
79
|
test('should not switch directionality when the text content changes after initial render and the forceDirection property was already set', function () {
|
|
67
|
-
var
|
|
80
|
+
var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
68
81
|
forceDirection: "ltr",
|
|
69
82
|
children: ltrText
|
|
70
|
-
}))
|
|
71
|
-
|
|
83
|
+
})),
|
|
84
|
+
rerender = _render2.rerender;
|
|
85
|
+
|
|
86
|
+
var marquee = _react.screen.getByText(ltrText);
|
|
87
|
+
|
|
88
|
+
rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
89
|
+
forceDirection: "ltr",
|
|
72
90
|
children: rtlText
|
|
73
|
-
});
|
|
74
|
-
subject.update();
|
|
91
|
+
}));
|
|
75
92
|
var expected = 'ltr';
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
expect(marquee).toHaveStyle({
|
|
94
|
+
'direction': expected
|
|
95
|
+
});
|
|
78
96
|
});
|
|
79
97
|
test('should override direction to RTL when forceDirection is set and locale is LTR', function () {
|
|
80
|
-
|
|
98
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
99
|
+
"data-testid": "marquee",
|
|
81
100
|
forceDirection: "rtl",
|
|
82
101
|
locale: "ltr"
|
|
83
102
|
}));
|
|
103
|
+
|
|
104
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
105
|
+
|
|
84
106
|
var expected = 'rtl';
|
|
85
|
-
|
|
86
|
-
|
|
107
|
+
expect(marquee).toHaveStyle({
|
|
108
|
+
'direction': expected
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
test('should not override direction to RTL when forceDirection is "locale" and locale is LTR', function () {
|
|
112
|
+
var _render3 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
113
|
+
forceDirection: "locale",
|
|
114
|
+
children: ltrText
|
|
115
|
+
})),
|
|
116
|
+
rerender = _render3.rerender;
|
|
117
|
+
|
|
118
|
+
var marquee = _react.screen.getByText(ltrText);
|
|
119
|
+
|
|
120
|
+
var expected = 'ltr';
|
|
121
|
+
expect(marquee).toHaveStyle({
|
|
122
|
+
'direction': expected
|
|
123
|
+
});
|
|
124
|
+
rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
125
|
+
forceDirection: "locale",
|
|
126
|
+
children: rtlText
|
|
127
|
+
}));
|
|
128
|
+
expect(marquee).toHaveStyle({
|
|
129
|
+
'direction': expected
|
|
130
|
+
});
|
|
87
131
|
});
|
|
88
132
|
test('should override direction to LTR when forceDirection is set and locale is RTL', function () {
|
|
89
|
-
|
|
133
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
134
|
+
"data-testid": "marquee",
|
|
90
135
|
forceDirection: "ltr",
|
|
91
136
|
locale: "rtl"
|
|
92
137
|
}));
|
|
138
|
+
|
|
139
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
140
|
+
|
|
93
141
|
var expected = 'ltr';
|
|
94
|
-
|
|
95
|
-
|
|
142
|
+
expect(marquee).toHaveStyle({
|
|
143
|
+
'direction': expected
|
|
144
|
+
});
|
|
96
145
|
});
|
|
97
146
|
test('should have direction of RTL when forceDirection is RTL and locale is RTL', function () {
|
|
98
|
-
|
|
147
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
148
|
+
"data-testid": "marquee",
|
|
99
149
|
forceDirection: "rtl",
|
|
100
150
|
locale: "rtl"
|
|
101
151
|
}));
|
|
152
|
+
|
|
153
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
154
|
+
|
|
102
155
|
var expected = 'rtl';
|
|
103
|
-
|
|
104
|
-
|
|
156
|
+
expect(marquee).toHaveStyle({
|
|
157
|
+
'direction': expected
|
|
158
|
+
});
|
|
105
159
|
});
|
|
106
160
|
test('should have direction of LTR when forceDirection is LTR and locale is LTR', function () {
|
|
107
|
-
|
|
161
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
162
|
+
"data-testid": "marquee",
|
|
108
163
|
forceDirection: "ltr",
|
|
109
164
|
locale: "ltr"
|
|
110
165
|
}));
|
|
166
|
+
|
|
167
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
168
|
+
|
|
111
169
|
var expected = 'ltr';
|
|
112
|
-
|
|
113
|
-
|
|
170
|
+
expect(marquee).toHaveStyle({
|
|
171
|
+
'direction': expected
|
|
172
|
+
});
|
|
114
173
|
});
|
|
115
174
|
test('should convert percentage values of marqueeSpacing to absolute values', function (done) {
|
|
116
|
-
|
|
117
|
-
|
|
175
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
176
|
+
"data-testid": "marquee",
|
|
118
177
|
marqueeOn: "render",
|
|
119
|
-
marqueeOnRenderDelay: 10
|
|
178
|
+
marqueeOnRenderDelay: 10,
|
|
179
|
+
marqueeSpacing: "60%"
|
|
120
180
|
}));
|
|
121
181
|
setTimeout(function () {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
|
|
182
|
+
var expected = '60';
|
|
183
|
+
|
|
184
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
185
|
+
|
|
186
|
+
expect(marquee).toHaveStyle({
|
|
187
|
+
'--ui-marquee-spacing': expected
|
|
188
|
+
});
|
|
126
189
|
done();
|
|
127
190
|
}, 100);
|
|
128
191
|
});
|
|
129
192
|
test('should pass absolute values of marqueeSpacing', function (done) {
|
|
130
|
-
|
|
131
|
-
|
|
193
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
194
|
+
"data-testid": "marquee",
|
|
132
195
|
marqueeOn: "render",
|
|
133
|
-
marqueeOnRenderDelay: 10
|
|
196
|
+
marqueeOnRenderDelay: 10,
|
|
197
|
+
marqueeSpacing: 80
|
|
134
198
|
}));
|
|
135
199
|
setTimeout(function () {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var
|
|
139
|
-
|
|
200
|
+
var expected = '80';
|
|
201
|
+
|
|
202
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0).children.item(0);
|
|
203
|
+
|
|
204
|
+
expect(marquee).toHaveStyle({
|
|
205
|
+
'--ui-marquee-spacing': expected
|
|
206
|
+
});
|
|
140
207
|
done();
|
|
141
208
|
}, 100);
|
|
142
209
|
});
|
|
@@ -144,150 +211,209 @@ describe('Marquee', function () {
|
|
|
144
211
|
describe('MarqueeBase', function () {
|
|
145
212
|
// Computed Property Tests
|
|
146
213
|
test('should not include the animate class when animating is false', function () {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
214
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
215
|
+
"data-testid": "marquee"
|
|
216
|
+
}));
|
|
217
|
+
|
|
218
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
219
|
+
|
|
220
|
+
var expected = 'animate';
|
|
221
|
+
expect(marquee).not.toHaveClass(expected);
|
|
151
222
|
});
|
|
152
223
|
test('should include the animate class when animating is true', function () {
|
|
153
|
-
|
|
154
|
-
animating: true
|
|
224
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
225
|
+
animating: true,
|
|
226
|
+
"data-testid": "marquee"
|
|
155
227
|
}));
|
|
156
|
-
|
|
157
|
-
var
|
|
158
|
-
|
|
228
|
+
|
|
229
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
230
|
+
|
|
231
|
+
var expected = 'animate';
|
|
232
|
+
expect(marquee).toHaveClass(expected);
|
|
159
233
|
});
|
|
160
234
|
test('should not transition when animating is false', function () {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
235
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
236
|
+
"data-testid": "marquee"
|
|
237
|
+
}));
|
|
238
|
+
|
|
239
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
240
|
+
|
|
241
|
+
expect(marquee).not.toHaveStyle({
|
|
242
|
+
'transition-duration': 'NaNs'
|
|
243
|
+
});
|
|
164
244
|
});
|
|
165
245
|
test('should transition when animating is true', function () {
|
|
166
|
-
|
|
167
|
-
animating: true
|
|
246
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
247
|
+
animating: true,
|
|
248
|
+
"data-testid": "marquee"
|
|
168
249
|
}));
|
|
169
|
-
|
|
170
|
-
|
|
250
|
+
|
|
251
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
252
|
+
|
|
253
|
+
expect(marquee).toHaveStyle({
|
|
254
|
+
'transition-duration': 'NaNs'
|
|
255
|
+
});
|
|
171
256
|
});
|
|
172
257
|
test('should set RTL direction in LTR context when the text directionality is RTL', function () {
|
|
173
|
-
|
|
258
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
259
|
+
"data-testid": "marquee",
|
|
174
260
|
rtl: true
|
|
175
261
|
}), {
|
|
176
262
|
context: {
|
|
177
263
|
rtl: false
|
|
178
264
|
}
|
|
179
265
|
});
|
|
266
|
+
|
|
267
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
268
|
+
|
|
180
269
|
var expected = 'rtl';
|
|
181
|
-
|
|
182
|
-
|
|
270
|
+
expect(marquee).toHaveStyle({
|
|
271
|
+
'direction': expected
|
|
272
|
+
});
|
|
183
273
|
});
|
|
184
274
|
test('should set LTR direction in RTL when the text directionality is LTR', function () {
|
|
185
|
-
|
|
275
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
276
|
+
"data-testid": "marquee"
|
|
277
|
+
}), {
|
|
186
278
|
context: {
|
|
187
279
|
rtl: true
|
|
188
280
|
}
|
|
189
281
|
});
|
|
282
|
+
|
|
283
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
284
|
+
|
|
190
285
|
var expected = 'ltr';
|
|
191
|
-
|
|
192
|
-
|
|
286
|
+
expect(marquee).toHaveStyle({
|
|
287
|
+
'direction': expected
|
|
288
|
+
});
|
|
193
289
|
});
|
|
194
290
|
test('should transition from the right with LTR text (a negative translate value)', function () {
|
|
195
|
-
|
|
291
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
196
292
|
animating: true,
|
|
293
|
+
"data-testid": "marquee",
|
|
197
294
|
distance: 100
|
|
198
295
|
}));
|
|
199
|
-
|
|
200
|
-
|
|
296
|
+
|
|
297
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
298
|
+
|
|
299
|
+
var expected = 'translateX(-100px)';
|
|
300
|
+
expect(marquee).toHaveStyle({
|
|
301
|
+
'transform': expected
|
|
302
|
+
});
|
|
201
303
|
});
|
|
202
304
|
test('should transition from the left with RTL text (a positive translate value)', function () {
|
|
203
|
-
|
|
305
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
204
306
|
animating: true,
|
|
307
|
+
"data-testid": "marquee",
|
|
205
308
|
distance: 100,
|
|
206
309
|
rtl: true
|
|
207
310
|
}));
|
|
208
|
-
|
|
209
|
-
|
|
311
|
+
|
|
312
|
+
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
313
|
+
|
|
314
|
+
var expected = 'translateX(100px)';
|
|
315
|
+
expect(marquee).toHaveStyle({
|
|
316
|
+
'transform': expected
|
|
317
|
+
});
|
|
210
318
|
});
|
|
211
319
|
test('should duplicate from content when promoted and a non-zero distance', function () {
|
|
212
|
-
|
|
213
|
-
willAnimate: true,
|
|
320
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
214
321
|
distance: 100,
|
|
322
|
+
willAnimate: true,
|
|
215
323
|
children: "Text"
|
|
216
324
|
}));
|
|
217
|
-
|
|
218
|
-
|
|
325
|
+
|
|
326
|
+
var marquee = _react.screen.getByText('TextText');
|
|
327
|
+
|
|
328
|
+
expect(marquee).toBeInTheDocument();
|
|
219
329
|
});
|
|
220
330
|
test('should not duplicate from content when promoted and a zero distance', function () {
|
|
221
|
-
|
|
222
|
-
willAnimate: true,
|
|
331
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
223
332
|
distance: 0,
|
|
333
|
+
willAnimate: true,
|
|
224
334
|
children: "Text"
|
|
225
335
|
}));
|
|
226
|
-
|
|
227
|
-
|
|
336
|
+
|
|
337
|
+
var marquee = _react.screen.getByText('Text');
|
|
338
|
+
|
|
339
|
+
expect(marquee).toBeInTheDocument();
|
|
228
340
|
});
|
|
229
341
|
test('should not duplicate from content when not promoted and a non-zero distance', function () {
|
|
230
|
-
|
|
342
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
231
343
|
distance: 100,
|
|
232
344
|
children: "Text"
|
|
233
345
|
}));
|
|
234
|
-
|
|
235
|
-
|
|
346
|
+
|
|
347
|
+
var marquee = _react.screen.getByText('Text');
|
|
348
|
+
|
|
349
|
+
expect(marquee).toBeInTheDocument();
|
|
236
350
|
});
|
|
237
351
|
test('should add aria-label with content when promoted and a non-zero distance', function () {
|
|
238
352
|
var text = 'Text';
|
|
239
|
-
|
|
240
|
-
|
|
353
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
354
|
+
"data-testid": "marquee",
|
|
241
355
|
distance: 100,
|
|
356
|
+
willAnimate: true,
|
|
242
357
|
children: text
|
|
243
358
|
}));
|
|
359
|
+
|
|
360
|
+
var marquee = _react.screen.getByTestId('marquee');
|
|
361
|
+
|
|
244
362
|
var expected = text;
|
|
245
|
-
|
|
246
|
-
expect(actual).toBe(expected);
|
|
363
|
+
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
247
364
|
});
|
|
248
365
|
test('should not override aria-label with content when promoted and a non-zero distance', function () {
|
|
249
366
|
var aria = 'Custom';
|
|
250
|
-
|
|
251
|
-
willAnimate: true,
|
|
252
|
-
distance: 100,
|
|
367
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
253
368
|
"aria-label": aria,
|
|
369
|
+
"data-testid": "marquee",
|
|
370
|
+
distance: 100,
|
|
371
|
+
willAnimate: true,
|
|
254
372
|
children: "Text"
|
|
255
373
|
}));
|
|
374
|
+
|
|
375
|
+
var marquee = _react.screen.getByTestId('marquee');
|
|
376
|
+
|
|
256
377
|
var expected = aria;
|
|
257
|
-
|
|
258
|
-
expect(actual).toBe(expected);
|
|
378
|
+
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
259
379
|
});
|
|
260
380
|
test('should concatenate string children when promoted and a non-zero distance', function () {
|
|
261
|
-
|
|
262
|
-
|
|
381
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.MarqueeBase, {
|
|
382
|
+
"data-testid": "marquee",
|
|
263
383
|
distance: 100,
|
|
384
|
+
willAnimate: true,
|
|
264
385
|
children: ["This is ", 'A', " test"]
|
|
265
386
|
}));
|
|
387
|
+
|
|
388
|
+
var marquee = _react.screen.getByTestId('marquee');
|
|
389
|
+
|
|
266
390
|
var expected = 'This is A test';
|
|
267
|
-
|
|
268
|
-
expect(actual).toBe(expected);
|
|
391
|
+
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
269
392
|
});
|
|
270
393
|
test('should not concatenate non-string children when promoted and a non-zero distance', function () {
|
|
271
|
-
|
|
272
|
-
|
|
394
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.MarqueeBase, {
|
|
395
|
+
"data-testid": "marquee",
|
|
273
396
|
distance: 100,
|
|
397
|
+
willAnimate: true,
|
|
274
398
|
children: ["Test", /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
275
399
|
children: "Hello"
|
|
276
400
|
}), "World"]
|
|
277
401
|
}));
|
|
402
|
+
|
|
403
|
+
var marquee = _react.screen.getByTestId('marquee');
|
|
404
|
+
|
|
278
405
|
var expected = 'Test World';
|
|
279
|
-
|
|
280
|
-
expect(actual).toBe(expected);
|
|
406
|
+
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
281
407
|
});
|
|
282
408
|
test('should not throw exception for null children when promoted and a non-zero distance - ENYO-6362', function () {
|
|
283
|
-
var
|
|
284
|
-
return (0,
|
|
285
|
-
willAnimate: true,
|
|
409
|
+
var renderSubject = function renderSubject() {
|
|
410
|
+
return (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
286
411
|
distance: 100,
|
|
412
|
+
willAnimate: true,
|
|
287
413
|
children: null
|
|
288
414
|
}));
|
|
289
415
|
};
|
|
290
416
|
|
|
291
|
-
expect(
|
|
417
|
+
expect(renderSubject).not.toThrow();
|
|
292
418
|
});
|
|
293
419
|
});
|
package/Media/Media.js
CHANGED
|
@@ -185,9 +185,7 @@ var Media = /*#__PURE__*/function (_ReactComponent) {
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
_this.handleEvent = function (ev) {
|
|
188
|
-
(0, _handle.
|
|
189
|
-
type: 'onUpdate'
|
|
190
|
-
}, _this.props); // fetch the forward() we generated earlier, using the event type as a key to find the real event name.
|
|
188
|
+
(0, _handle.forwardCustom)('onUpdate')(null, _this.props); // fetch the forward() we generated earlier, using the event type as a key to find the real event name.
|
|
191
189
|
|
|
192
190
|
var fwd = _this.handledMediaForwards[handledMediaEventsMap[ev.type]];
|
|
193
191
|
|