@instructure/ui-pagination 10.2.3-snapshot-13 → 10.2.3-snapshot-15
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 +1 -1
- package/es/Pagination/PaginationArrowButton/__new-tests__/PaginationArrowButton.test.js +1 -1
- package/es/Pagination/PaginationButton/__new-tests__/PaginationButton.test.js +2 -2
- package/es/Pagination/PaginationPageInput/__new-tests__/PaginationPageInput.test.js +8 -8
- package/es/Pagination/__new-tests__/Pagination.test.js +53 -53
- package/lib/Pagination/PaginationArrowButton/__new-tests__/PaginationArrowButton.test.js +1 -1
- package/lib/Pagination/PaginationButton/__new-tests__/PaginationButton.test.js +2 -2
- package/lib/Pagination/PaginationPageInput/__new-tests__/PaginationPageInput.test.js +8 -8
- package/lib/Pagination/__new-tests__/Pagination.test.js +53 -53
- package/package.json +24 -24
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Pagination/PaginationArrowButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationPageInput/index.d.ts +16 -2
- package/types/Pagination/PaginationPageInput/index.d.ts.map +1 -1
- package/types/Pagination/index.d.ts.map +1 -1
|
@@ -34,7 +34,7 @@ const defaultSRLabel = (currentPage, numberOfPages) => `Select page (${currentPa
|
|
|
34
34
|
describe('<PaginationPageInput />', () => {
|
|
35
35
|
it('should render', async () => {
|
|
36
36
|
const defaultOnChange = _vitest.vi.fn();
|
|
37
|
-
(0, _react2.render)(
|
|
37
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
38
38
|
numberOfPages: 10,
|
|
39
39
|
currentPageIndex: 0,
|
|
40
40
|
onChange: defaultOnChange,
|
|
@@ -46,7 +46,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
46
46
|
});
|
|
47
47
|
it('should display the current page number', async () => {
|
|
48
48
|
const defaultOnChange = _vitest.vi.fn();
|
|
49
|
-
(0, _react2.render)(
|
|
49
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
50
50
|
numberOfPages: 10,
|
|
51
51
|
currentPageIndex: 3,
|
|
52
52
|
onChange: defaultOnChange,
|
|
@@ -57,7 +57,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
57
57
|
});
|
|
58
58
|
it('should correctly update page number', async () => {
|
|
59
59
|
const defaultOnChange = _vitest.vi.fn();
|
|
60
|
-
const _render = (0, _react2.render)(
|
|
60
|
+
const _render = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
61
61
|
numberOfPages: 10,
|
|
62
62
|
currentPageIndex: 3,
|
|
63
63
|
onChange: defaultOnChange,
|
|
@@ -68,7 +68,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
68
68
|
expect(input).toHaveAttribute('value', '4');
|
|
69
69
|
|
|
70
70
|
// Set currentPageIndex: 6
|
|
71
|
-
rerender(
|
|
71
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
72
72
|
numberOfPages: 10,
|
|
73
73
|
currentPageIndex: 6,
|
|
74
74
|
onChange: defaultOnChange,
|
|
@@ -78,7 +78,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
78
78
|
});
|
|
79
79
|
it("shouldn't display the arrow keys of NumberInput", async () => {
|
|
80
80
|
const defaultOnChange = _vitest.vi.fn();
|
|
81
|
-
const _render2 = (0, _react2.render)(
|
|
81
|
+
const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
82
82
|
numberOfPages: 10,
|
|
83
83
|
currentPageIndex: 3,
|
|
84
84
|
onChange: defaultOnChange,
|
|
@@ -92,7 +92,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
92
92
|
});
|
|
93
93
|
it("should disable the input on 'disabled'", async () => {
|
|
94
94
|
const defaultOnChange = _vitest.vi.fn();
|
|
95
|
-
(0, _react2.render)(
|
|
95
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
96
96
|
numberOfPages: 10,
|
|
97
97
|
currentPageIndex: 3,
|
|
98
98
|
onChange: defaultOnChange,
|
|
@@ -104,7 +104,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
104
104
|
});
|
|
105
105
|
it('should set the ScreenReaderLabel for the input', async () => {
|
|
106
106
|
const defaultOnChange = _vitest.vi.fn();
|
|
107
|
-
const _render3 = (0, _react2.render)(
|
|
107
|
+
const _render3 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
108
108
|
numberOfPages: 10,
|
|
109
109
|
currentPageIndex: 3,
|
|
110
110
|
onChange: defaultOnChange,
|
|
@@ -116,7 +116,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
116
116
|
});
|
|
117
117
|
it('should display the number of pages in the label', async () => {
|
|
118
118
|
const defaultOnChange = _vitest.vi.fn();
|
|
119
|
-
const _render4 = (0, _react2.render)(
|
|
119
|
+
const _render4 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationPageInput, {
|
|
120
120
|
numberOfPages: 10,
|
|
121
121
|
currentPageIndex: 3,
|
|
122
122
|
onChange: defaultOnChange,
|
|
@@ -54,7 +54,7 @@ describe('<Pagination />', () => {
|
|
|
54
54
|
consoleErrorMock.mockRestore();
|
|
55
55
|
});
|
|
56
56
|
it('should render all pages buttons', async () => {
|
|
57
|
-
(0, _react2.render)(
|
|
57
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
58
58
|
variant: "compact"
|
|
59
59
|
}, buildPages(5)));
|
|
60
60
|
const buttons = _react2.screen.getAllByRole('button');
|
|
@@ -64,7 +64,7 @@ describe('<Pagination />', () => {
|
|
|
64
64
|
});
|
|
65
65
|
describe('with 5 or less pages', () => {
|
|
66
66
|
it('should not render next/prev buttons', async () => {
|
|
67
|
-
(0, _react2.render)(
|
|
67
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
68
68
|
label: "Example",
|
|
69
69
|
variant: "compact",
|
|
70
70
|
labelNext: "Next",
|
|
@@ -78,7 +78,7 @@ describe('<Pagination />', () => {
|
|
|
78
78
|
expect(prevButton).not.toBeInTheDocument();
|
|
79
79
|
});
|
|
80
80
|
it('should not render first/last buttons', async () => {
|
|
81
|
-
(0, _react2.render)(
|
|
81
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
82
82
|
label: "Example",
|
|
83
83
|
variant: "compact",
|
|
84
84
|
labelNext: "Next",
|
|
@@ -97,7 +97,7 @@ describe('<Pagination />', () => {
|
|
|
97
97
|
});
|
|
98
98
|
describe('should meet a11y standards', () => {
|
|
99
99
|
it('by default', async () => {
|
|
100
|
-
const _render = (0, _react2.render)(
|
|
100
|
+
const _render = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
101
101
|
variant: "compact",
|
|
102
102
|
labelNext: "Next",
|
|
103
103
|
labelPrev: "Prev"
|
|
@@ -107,7 +107,7 @@ describe('<Pagination />', () => {
|
|
|
107
107
|
expect(axeCheck).toBe(true);
|
|
108
108
|
});
|
|
109
109
|
it('by default with more pages', async () => {
|
|
110
|
-
const _render2 = (0, _react2.render)(
|
|
110
|
+
const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
111
111
|
variant: "compact",
|
|
112
112
|
labelNext: "Next",
|
|
113
113
|
labelPrev: "Prev"
|
|
@@ -117,7 +117,7 @@ describe('<Pagination />', () => {
|
|
|
117
117
|
expect(axeCheck).toBe(true);
|
|
118
118
|
});
|
|
119
119
|
it('with first/last arrows', async () => {
|
|
120
|
-
const _render3 = (0, _react2.render)(
|
|
120
|
+
const _render3 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
121
121
|
variant: "compact",
|
|
122
122
|
labelNext: "Next",
|
|
123
123
|
labelPrev: "Prev",
|
|
@@ -130,7 +130,7 @@ describe('<Pagination />', () => {
|
|
|
130
130
|
expect(axeCheck).toBe(true);
|
|
131
131
|
});
|
|
132
132
|
it('with disabled arrows', async () => {
|
|
133
|
-
const _render4 = (0, _react2.render)(
|
|
133
|
+
const _render4 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
134
134
|
variant: "compact",
|
|
135
135
|
labelNext: "Next",
|
|
136
136
|
labelPrev: "Prev",
|
|
@@ -145,7 +145,7 @@ describe('<Pagination />', () => {
|
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
it('should render page buttons', async () => {
|
|
148
|
-
(0, _react2.render)(
|
|
148
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
149
149
|
variant: "compact",
|
|
150
150
|
labelNext: "Next",
|
|
151
151
|
labelPrev: "Prev"
|
|
@@ -156,7 +156,7 @@ describe('<Pagination />', () => {
|
|
|
156
156
|
expect(pagination).toHaveTextContent('#0#1#2#3#4');
|
|
157
157
|
});
|
|
158
158
|
it('should render a single page button', async () => {
|
|
159
|
-
(0, _react2.render)(
|
|
159
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
160
160
|
variant: "compact",
|
|
161
161
|
labelNext: "Next",
|
|
162
162
|
labelPrev: "Prev"
|
|
@@ -178,7 +178,7 @@ describe('<Pagination />', () => {
|
|
|
178
178
|
expect(buttons.length).toEqual(0);
|
|
179
179
|
});
|
|
180
180
|
it('should truncate pages to context', async () => {
|
|
181
|
-
(0, _react2.render)(
|
|
181
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
182
182
|
variant: "compact",
|
|
183
183
|
labelNext: "Next",
|
|
184
184
|
labelPrev: "Prev"
|
|
@@ -198,7 +198,7 @@ describe('<Pagination />', () => {
|
|
|
198
198
|
expect(ellipses.length).toEqual(2);
|
|
199
199
|
});
|
|
200
200
|
it('should truncate start', async () => {
|
|
201
|
-
(0, _react2.render)(
|
|
201
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
202
202
|
variant: "compact",
|
|
203
203
|
labelNext: "Next",
|
|
204
204
|
labelPrev: "Prev"
|
|
@@ -218,7 +218,7 @@ describe('<Pagination />', () => {
|
|
|
218
218
|
expect(ellipses.length).toEqual(1);
|
|
219
219
|
});
|
|
220
220
|
it('should truncate end', async () => {
|
|
221
|
-
(0, _react2.render)(
|
|
221
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
222
222
|
variant: "compact",
|
|
223
223
|
labelNext: "Next",
|
|
224
224
|
labelPrev: "Prev"
|
|
@@ -238,7 +238,7 @@ describe('<Pagination />', () => {
|
|
|
238
238
|
expect(ellipses.length).toEqual(1);
|
|
239
239
|
});
|
|
240
240
|
it('should omit ellipses when bounds included in context', async () => {
|
|
241
|
-
(0, _react2.render)(
|
|
241
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
242
242
|
variant: "compact",
|
|
243
243
|
labelNext: "Next",
|
|
244
244
|
labelPrev: "Prev"
|
|
@@ -259,7 +259,7 @@ describe('<Pagination />', () => {
|
|
|
259
259
|
});
|
|
260
260
|
describe('when updating with the FIRST page becoming current', () => {
|
|
261
261
|
it('should move focus from the Previous Page button to the first page button', async () => {
|
|
262
|
-
const _render5 = (0, _react2.render)(
|
|
262
|
+
const _render5 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
263
263
|
variant: "compact",
|
|
264
264
|
labelNext: "Next",
|
|
265
265
|
labelPrev: "Previous"
|
|
@@ -272,7 +272,7 @@ describe('<Pagination />', () => {
|
|
|
272
272
|
expect(prevButton).toHaveFocus();
|
|
273
273
|
|
|
274
274
|
// Set children: buildPages(7, 0)
|
|
275
|
-
rerender(
|
|
275
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
276
276
|
variant: "compact",
|
|
277
277
|
labelNext: "Next",
|
|
278
278
|
labelPrev: "Previous"
|
|
@@ -283,7 +283,7 @@ describe('<Pagination />', () => {
|
|
|
283
283
|
expect(button0).toHaveFocus();
|
|
284
284
|
});
|
|
285
285
|
it('should move focus from the First Page button to the first page button', async () => {
|
|
286
|
-
const _render6 = (0, _react2.render)(
|
|
286
|
+
const _render6 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
287
287
|
variant: "compact",
|
|
288
288
|
labelNext: "Next",
|
|
289
289
|
labelPrev: "Previous",
|
|
@@ -299,7 +299,7 @@ describe('<Pagination />', () => {
|
|
|
299
299
|
expect(firstButton).toHaveFocus();
|
|
300
300
|
|
|
301
301
|
// Set children: buildPages(7, 0)
|
|
302
|
-
rerender(
|
|
302
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
303
303
|
variant: "compact",
|
|
304
304
|
labelNext: "Next",
|
|
305
305
|
labelPrev: "Previous",
|
|
@@ -313,7 +313,7 @@ describe('<Pagination />', () => {
|
|
|
313
313
|
expect(button0).toHaveFocus();
|
|
314
314
|
});
|
|
315
315
|
it('should not change focus when the Previous Page button did not have focus', async () => {
|
|
316
|
-
const _render7 = (0, _react2.render)(
|
|
316
|
+
const _render7 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
317
317
|
variant: "compact",
|
|
318
318
|
labelNext: "Next",
|
|
319
319
|
labelPrev: "Previous"
|
|
@@ -324,7 +324,7 @@ describe('<Pagination />', () => {
|
|
|
324
324
|
});
|
|
325
325
|
button1.focus();
|
|
326
326
|
expect(button1).toHaveFocus();
|
|
327
|
-
rerender(
|
|
327
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
328
328
|
variant: "compact",
|
|
329
329
|
labelNext: "Next",
|
|
330
330
|
labelPrev: "Previous"
|
|
@@ -332,7 +332,7 @@ describe('<Pagination />', () => {
|
|
|
332
332
|
expect(button1).toHaveFocus();
|
|
333
333
|
});
|
|
334
334
|
it('should not change focus when the First Page button did not have focus', async () => {
|
|
335
|
-
const _render8 = (0, _react2.render)(
|
|
335
|
+
const _render8 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
336
336
|
variant: "compact",
|
|
337
337
|
labelNext: "Next",
|
|
338
338
|
labelPrev: "Previous",
|
|
@@ -346,7 +346,7 @@ describe('<Pagination />', () => {
|
|
|
346
346
|
});
|
|
347
347
|
button1.focus();
|
|
348
348
|
expect(button1).toHaveFocus();
|
|
349
|
-
rerender(
|
|
349
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
350
350
|
variant: "compact",
|
|
351
351
|
labelNext: "Next",
|
|
352
352
|
labelPrev: "Previous",
|
|
@@ -357,7 +357,7 @@ describe('<Pagination />', () => {
|
|
|
357
357
|
expect(button1).toHaveFocus();
|
|
358
358
|
});
|
|
359
359
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
360
|
-
const _render9 = (0, _react2.render)(
|
|
360
|
+
const _render9 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
361
361
|
variant: "compact",
|
|
362
362
|
labelNext: "Next",
|
|
363
363
|
labelPrev: "Previous"
|
|
@@ -370,7 +370,7 @@ describe('<Pagination />', () => {
|
|
|
370
370
|
expect(prevButton).toHaveFocus();
|
|
371
371
|
|
|
372
372
|
// Set children: buildPages(7, 0)
|
|
373
|
-
rerender(
|
|
373
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
374
374
|
variant: "compact",
|
|
375
375
|
labelNext: "Next",
|
|
376
376
|
labelPrev: "Previous"
|
|
@@ -382,7 +382,7 @@ describe('<Pagination />', () => {
|
|
|
382
382
|
expect(button1).toHaveFocus();
|
|
383
383
|
|
|
384
384
|
// Set children: buildPages(7, 0)
|
|
385
|
-
rerender(
|
|
385
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
386
386
|
variant: "compact",
|
|
387
387
|
labelNext: "Next",
|
|
388
388
|
labelPrev: "Previous"
|
|
@@ -392,7 +392,7 @@ describe('<Pagination />', () => {
|
|
|
392
392
|
});
|
|
393
393
|
describe('when updating with the LAST page becoming current', () => {
|
|
394
394
|
it('should move focus from the Next Page button to the last page button', async () => {
|
|
395
|
-
const _render10 = (0, _react2.render)(
|
|
395
|
+
const _render10 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
396
396
|
variant: "compact",
|
|
397
397
|
labelNext: "Next",
|
|
398
398
|
labelPrev: "Previous"
|
|
@@ -405,7 +405,7 @@ describe('<Pagination />', () => {
|
|
|
405
405
|
expect(nextButton).toHaveFocus();
|
|
406
406
|
|
|
407
407
|
// Set children: buildPages(7, 6)
|
|
408
|
-
rerender(
|
|
408
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
409
409
|
variant: "compact",
|
|
410
410
|
labelNext: "Next",
|
|
411
411
|
labelPrev: "Previous"
|
|
@@ -416,7 +416,7 @@ describe('<Pagination />', () => {
|
|
|
416
416
|
expect(button6).toHaveFocus();
|
|
417
417
|
});
|
|
418
418
|
it('should move focus from the Last Page button to the last page button', async () => {
|
|
419
|
-
const _render11 = (0, _react2.render)(
|
|
419
|
+
const _render11 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
420
420
|
variant: "compact",
|
|
421
421
|
labelNext: "Next",
|
|
422
422
|
labelPrev: "Previous",
|
|
@@ -432,7 +432,7 @@ describe('<Pagination />', () => {
|
|
|
432
432
|
expect(lastButton).toHaveFocus();
|
|
433
433
|
|
|
434
434
|
// Set children: buildPages(7, 6)
|
|
435
|
-
rerender(
|
|
435
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
436
436
|
variant: "compact",
|
|
437
437
|
labelNext: "Next",
|
|
438
438
|
labelPrev: "Previous",
|
|
@@ -446,7 +446,7 @@ describe('<Pagination />', () => {
|
|
|
446
446
|
expect(button6).toHaveFocus();
|
|
447
447
|
});
|
|
448
448
|
it('should not change focus when the Next Page button did not have focus', async () => {
|
|
449
|
-
const _render12 = (0, _react2.render)(
|
|
449
|
+
const _render12 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
450
450
|
variant: "compact",
|
|
451
451
|
labelNext: "Next",
|
|
452
452
|
labelPrev: "Previous"
|
|
@@ -459,7 +459,7 @@ describe('<Pagination />', () => {
|
|
|
459
459
|
expect(button5).toHaveFocus();
|
|
460
460
|
|
|
461
461
|
// Set children: buildPages(7, 5)
|
|
462
|
-
rerender(
|
|
462
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
463
463
|
variant: "compact",
|
|
464
464
|
labelNext: "Next",
|
|
465
465
|
labelPrev: "Previous"
|
|
@@ -467,7 +467,7 @@ describe('<Pagination />', () => {
|
|
|
467
467
|
expect(button5).toHaveFocus();
|
|
468
468
|
});
|
|
469
469
|
it('should not change focus when the Last Page button did not have focus', async () => {
|
|
470
|
-
const _render13 = (0, _react2.render)(
|
|
470
|
+
const _render13 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
471
471
|
variant: "compact",
|
|
472
472
|
labelNext: "Next",
|
|
473
473
|
labelPrev: "Previous",
|
|
@@ -483,7 +483,7 @@ describe('<Pagination />', () => {
|
|
|
483
483
|
expect(button5).toHaveFocus();
|
|
484
484
|
|
|
485
485
|
// Set children: buildPages(7, 6)
|
|
486
|
-
rerender(
|
|
486
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
487
487
|
variant: "compact",
|
|
488
488
|
labelNext: "Next",
|
|
489
489
|
labelPrev: "Previous",
|
|
@@ -494,7 +494,7 @@ describe('<Pagination />', () => {
|
|
|
494
494
|
expect(button5).toHaveFocus();
|
|
495
495
|
});
|
|
496
496
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
497
|
-
const _render14 = (0, _react2.render)(
|
|
497
|
+
const _render14 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
498
498
|
variant: "compact",
|
|
499
499
|
labelNext: "Next",
|
|
500
500
|
labelPrev: "Previous"
|
|
@@ -507,7 +507,7 @@ describe('<Pagination />', () => {
|
|
|
507
507
|
expect(nextButton).toHaveFocus();
|
|
508
508
|
|
|
509
509
|
// Set children: buildPages(7, 6)
|
|
510
|
-
rerender(
|
|
510
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
511
511
|
variant: "compact",
|
|
512
512
|
labelNext: "Next",
|
|
513
513
|
labelPrev: "Previous"
|
|
@@ -519,7 +519,7 @@ describe('<Pagination />', () => {
|
|
|
519
519
|
expect(button5).toHaveFocus();
|
|
520
520
|
|
|
521
521
|
// Set children: buildPages(7, 6)
|
|
522
|
-
rerender(
|
|
522
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
523
523
|
variant: "compact",
|
|
524
524
|
labelNext: "Next",
|
|
525
525
|
labelPrev: "Previous"
|
|
@@ -530,7 +530,7 @@ describe('<Pagination />', () => {
|
|
|
530
530
|
describe('arrows', () => {
|
|
531
531
|
describe('should render', () => {
|
|
532
532
|
it('only the stepper arrows when available', async () => {
|
|
533
|
-
const _render15 = (0, _react2.render)(
|
|
533
|
+
const _render15 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
534
534
|
variant: "compact",
|
|
535
535
|
labelNext: "Next",
|
|
536
536
|
labelPrev: "Previous"
|
|
@@ -546,7 +546,7 @@ describe('<Pagination />', () => {
|
|
|
546
546
|
expect(nextButton).toBeInTheDocument();
|
|
547
547
|
|
|
548
548
|
// Set children: buildPages(6, 5)
|
|
549
|
-
rerender(
|
|
549
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
550
550
|
variant: "compact",
|
|
551
551
|
labelNext: "Next",
|
|
552
552
|
labelPrev: "Previous"
|
|
@@ -561,7 +561,7 @@ describe('<Pagination />', () => {
|
|
|
561
561
|
expect(nextButtonUpdated).not.toBeInTheDocument();
|
|
562
562
|
});
|
|
563
563
|
it('the First and Last arrows withFirstAndLastButton', async () => {
|
|
564
|
-
const _render16 = (0, _react2.render)(
|
|
564
|
+
const _render16 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
565
565
|
variant: "compact",
|
|
566
566
|
labelNext: "Next",
|
|
567
567
|
labelPrev: "Previous",
|
|
@@ -580,7 +580,7 @@ describe('<Pagination />', () => {
|
|
|
580
580
|
expect(lastButton).toBeInTheDocument();
|
|
581
581
|
|
|
582
582
|
// Set children: buildPages(6, 5)
|
|
583
|
-
rerender(
|
|
583
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
584
584
|
variant: "compact",
|
|
585
585
|
labelNext: "Next",
|
|
586
586
|
labelPrev: "Previous",
|
|
@@ -598,7 +598,7 @@ describe('<Pagination />', () => {
|
|
|
598
598
|
expect(lastButtonUpdated).not.toBeInTheDocument();
|
|
599
599
|
});
|
|
600
600
|
it('the disabled arrows with showDisabledButtons', async () => {
|
|
601
|
-
const _render17 = (0, _react2.render)(
|
|
601
|
+
const _render17 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
602
602
|
variant: "compact",
|
|
603
603
|
labelNext: "Next",
|
|
604
604
|
labelPrev: "Previous",
|
|
@@ -627,7 +627,7 @@ describe('<Pagination />', () => {
|
|
|
627
627
|
|
|
628
628
|
// Go to last item
|
|
629
629
|
// Set children: buildPages(6, 5)
|
|
630
|
-
rerender(
|
|
630
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
631
631
|
variant: "compact",
|
|
632
632
|
labelNext: "Next",
|
|
633
633
|
labelPrev: "Previous",
|
|
@@ -655,7 +655,7 @@ describe('<Pagination />', () => {
|
|
|
655
655
|
});
|
|
656
656
|
});
|
|
657
657
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
658
|
-
const _render18 = (0, _react2.render)(
|
|
658
|
+
const _render18 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
659
659
|
variant: "compact",
|
|
660
660
|
labelNext: "Next",
|
|
661
661
|
labelPrev: "Previous"
|
|
@@ -671,7 +671,7 @@ describe('<Pagination />', () => {
|
|
|
671
671
|
expect(nextButton).toBeInTheDocument();
|
|
672
672
|
|
|
673
673
|
// Set children: buildPages(6, 5)
|
|
674
|
-
rerender(
|
|
674
|
+
rerender(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
675
675
|
variant: "compact",
|
|
676
676
|
labelNext: "Next",
|
|
677
677
|
labelPrev: "Previous"
|
|
@@ -697,7 +697,7 @@ describe('<Pagination />', () => {
|
|
|
697
697
|
const props = {
|
|
698
698
|
[prop]: 'foo'
|
|
699
699
|
};
|
|
700
|
-
(0, _react2.render)(
|
|
700
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, Object.assign({
|
|
701
701
|
variant: "compact",
|
|
702
702
|
labelNext: "Next",
|
|
703
703
|
labelPrev: "Previous"
|
|
@@ -711,7 +711,7 @@ describe('<Pagination />', () => {
|
|
|
711
711
|
const props = {
|
|
712
712
|
[prop]: allowedProps[prop]
|
|
713
713
|
};
|
|
714
|
-
(0, _react2.render)(
|
|
714
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, Object.assign({
|
|
715
715
|
variant: "compact",
|
|
716
716
|
labelNext: "Next",
|
|
717
717
|
labelPrev: "Previous"
|
|
@@ -725,7 +725,7 @@ describe('<Pagination />', () => {
|
|
|
725
725
|
});
|
|
726
726
|
it(`should pass down the elementRef prop`, async () => {
|
|
727
727
|
const elementRef = _vitest.vi.fn();
|
|
728
|
-
const _render19 = (0, _react2.render)(
|
|
728
|
+
const _render19 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
729
729
|
elementRef: elementRef,
|
|
730
730
|
variant: "compact",
|
|
731
731
|
labelNext: "Next",
|
|
@@ -736,7 +736,7 @@ describe('<Pagination />', () => {
|
|
|
736
736
|
});
|
|
737
737
|
it('should navigate to adjacent pages', async () => {
|
|
738
738
|
const onClick = _vitest.vi.fn();
|
|
739
|
-
(0, _react2.render)(
|
|
739
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
740
740
|
variant: "compact",
|
|
741
741
|
labelNext: "Next",
|
|
742
742
|
labelPrev: "Previous"
|
|
@@ -755,7 +755,7 @@ describe('<Pagination />', () => {
|
|
|
755
755
|
});
|
|
756
756
|
describe('input variant', () => {
|
|
757
757
|
it('should display number input', async () => {
|
|
758
|
-
const _render20 = (0, _react2.render)(
|
|
758
|
+
const _render20 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
759
759
|
variant: "input",
|
|
760
760
|
labelNext: "Next",
|
|
761
761
|
labelPrev: "Previous",
|
|
@@ -767,7 +767,7 @@ describe('<Pagination />', () => {
|
|
|
767
767
|
expect(numberInput).toHaveValue(3);
|
|
768
768
|
});
|
|
769
769
|
it('should display all arrow buttons', async () => {
|
|
770
|
-
(0, _react2.render)(
|
|
770
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
771
771
|
variant: "input",
|
|
772
772
|
labelNext: "Next",
|
|
773
773
|
labelPrev: "Prev",
|
|
@@ -792,7 +792,7 @@ describe('<Pagination />', () => {
|
|
|
792
792
|
expect(lastButton).toBeVisible();
|
|
793
793
|
});
|
|
794
794
|
it('should pass label', async () => {
|
|
795
|
-
const _render21 = (0, _react2.render)(
|
|
795
|
+
const _render21 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
796
796
|
variant: "input",
|
|
797
797
|
labelNext: "Next",
|
|
798
798
|
labelPrev: "Previous",
|
|
@@ -804,7 +804,7 @@ describe('<Pagination />', () => {
|
|
|
804
804
|
expect(container).toHaveTextContent('custom-input-label: 6');
|
|
805
805
|
});
|
|
806
806
|
it('should pass ScreenReaderLabel', async () => {
|
|
807
|
-
const _render22 = (0, _react2.render)(
|
|
807
|
+
const _render22 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
808
808
|
variant: "input",
|
|
809
809
|
labelNext: "Next",
|
|
810
810
|
labelPrev: "Previous",
|
|
@@ -818,7 +818,7 @@ describe('<Pagination />', () => {
|
|
|
818
818
|
it('should change pages on input change', async () => {
|
|
819
819
|
const onClick1 = _vitest.vi.fn();
|
|
820
820
|
const onClick2 = _vitest.vi.fn();
|
|
821
|
-
const _render23 = (0, _react2.render)(
|
|
821
|
+
const _render23 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
822
822
|
variant: "input",
|
|
823
823
|
labelNext: "Next",
|
|
824
824
|
labelPrev: "Previous",
|
|
@@ -942,7 +942,7 @@ describe('<Pagination />', () => {
|
|
|
942
942
|
});
|
|
943
943
|
it('should render custom buttons', () => {
|
|
944
944
|
const pageMap = ['A-G', 'H-J', 'K-M', 'N-Q', 'R-Z'];
|
|
945
|
-
const _render32 = (0, _react2.render)(
|
|
945
|
+
const _render32 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Pagination, {
|
|
946
946
|
variant: "full",
|
|
947
947
|
labelNext: "Next Page",
|
|
948
948
|
labelPrev: "Previous Page",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pagination",
|
|
3
|
-
"version": "10.2.3-snapshot-
|
|
3
|
+
"version": "10.2.3-snapshot-15",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,33 +23,33 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.2.3-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "10.2.3-snapshot-
|
|
28
|
-
"@instructure/ui-test-utils": "10.2.3-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "10.2.3-snapshot-15",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.2.3-snapshot-15",
|
|
28
|
+
"@instructure/ui-test-utils": "10.2.3-snapshot-15",
|
|
29
29
|
"@testing-library/jest-dom": "^6.4.6",
|
|
30
|
-
"@testing-library/react": "^
|
|
30
|
+
"@testing-library/react": "^16.0.1",
|
|
31
31
|
"@testing-library/user-event": "^14.5.2",
|
|
32
|
-
"vitest": "^2.
|
|
32
|
+
"vitest": "^2.1.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@babel/runtime": "^7.
|
|
36
|
-
"@instructure/emotion": "10.2.3-snapshot-
|
|
37
|
-
"@instructure/shared-types": "10.2.3-snapshot-
|
|
38
|
-
"@instructure/ui-a11y-content": "10.2.3-snapshot-
|
|
39
|
-
"@instructure/ui-a11y-utils": "10.2.3-snapshot-
|
|
40
|
-
"@instructure/ui-buttons": "10.2.3-snapshot-
|
|
41
|
-
"@instructure/ui-dom-utils": "10.2.3-snapshot-
|
|
42
|
-
"@instructure/ui-icons": "10.2.3-snapshot-
|
|
43
|
-
"@instructure/ui-number-input": "10.2.3-snapshot-
|
|
44
|
-
"@instructure/ui-portal": "10.2.3-snapshot-
|
|
45
|
-
"@instructure/ui-prop-types": "10.2.3-snapshot-
|
|
46
|
-
"@instructure/ui-react-utils": "10.2.3-snapshot-
|
|
47
|
-
"@instructure/ui-testable": "10.2.3-snapshot-
|
|
48
|
-
"@instructure/ui-themes": "10.2.3-snapshot-
|
|
49
|
-
"@instructure/ui-tooltip": "10.2.3-snapshot-
|
|
50
|
-
"@instructure/ui-utils": "10.2.3-snapshot-
|
|
51
|
-
"@instructure/ui-view": "10.2.3-snapshot-
|
|
52
|
-
"@instructure/uid": "10.2.3-snapshot-
|
|
35
|
+
"@babel/runtime": "^7.25.6",
|
|
36
|
+
"@instructure/emotion": "10.2.3-snapshot-15",
|
|
37
|
+
"@instructure/shared-types": "10.2.3-snapshot-15",
|
|
38
|
+
"@instructure/ui-a11y-content": "10.2.3-snapshot-15",
|
|
39
|
+
"@instructure/ui-a11y-utils": "10.2.3-snapshot-15",
|
|
40
|
+
"@instructure/ui-buttons": "10.2.3-snapshot-15",
|
|
41
|
+
"@instructure/ui-dom-utils": "10.2.3-snapshot-15",
|
|
42
|
+
"@instructure/ui-icons": "10.2.3-snapshot-15",
|
|
43
|
+
"@instructure/ui-number-input": "10.2.3-snapshot-15",
|
|
44
|
+
"@instructure/ui-portal": "10.2.3-snapshot-15",
|
|
45
|
+
"@instructure/ui-prop-types": "10.2.3-snapshot-15",
|
|
46
|
+
"@instructure/ui-react-utils": "10.2.3-snapshot-15",
|
|
47
|
+
"@instructure/ui-testable": "10.2.3-snapshot-15",
|
|
48
|
+
"@instructure/ui-themes": "10.2.3-snapshot-15",
|
|
49
|
+
"@instructure/ui-tooltip": "10.2.3-snapshot-15",
|
|
50
|
+
"@instructure/ui-utils": "10.2.3-snapshot-15",
|
|
51
|
+
"@instructure/ui-view": "10.2.3-snapshot-15",
|
|
52
|
+
"@instructure/uid": "10.2.3-snapshot-15",
|
|
53
53
|
"prop-types": "^15.8.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|