@instructure/ui-pagination 10.2.3-snapshot-14 → 10.2.3-snapshot-16
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
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [10.2.3-snapshot-
|
|
6
|
+
## [10.2.3-snapshot-16](https://github.com/instructure/instructure-ui/compare/v10.2.2...v10.2.3-snapshot-16) (2024-10-03)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -41,7 +41,7 @@ describe('<PaginationArrowButton />', () => {
|
|
|
41
41
|
});
|
|
42
42
|
it('should provide a ref to the button element', async () => {
|
|
43
43
|
const buttonRef = vi.fn();
|
|
44
|
-
render(
|
|
44
|
+
render(/*#__PURE__*/React.createElement(PaginationArrowButton, {
|
|
45
45
|
direction: "prev",
|
|
46
46
|
label: "Label",
|
|
47
47
|
buttonRef: buttonRef
|
|
@@ -40,7 +40,7 @@ describe('<PaginationButton />', () => {
|
|
|
40
40
|
});
|
|
41
41
|
it('should navigate using button when onClick provided', async () => {
|
|
42
42
|
const onClick = vi.fn();
|
|
43
|
-
render(
|
|
43
|
+
render(/*#__PURE__*/React.createElement(PaginationButton, {
|
|
44
44
|
onClick: onClick
|
|
45
45
|
}, "1"));
|
|
46
46
|
const button = screen.getByRole('button', {
|
|
@@ -53,7 +53,7 @@ describe('<PaginationButton />', () => {
|
|
|
53
53
|
});
|
|
54
54
|
it('should disable navigation to current page', async () => {
|
|
55
55
|
const onClick = vi.fn();
|
|
56
|
-
render(
|
|
56
|
+
render(/*#__PURE__*/React.createElement(PaginationButton, {
|
|
57
57
|
onClick: onClick,
|
|
58
58
|
current: true
|
|
59
59
|
}, "1"));
|
|
@@ -31,7 +31,7 @@ const defaultSRLabel = (currentPage, numberOfPages) => `Select page (${currentPa
|
|
|
31
31
|
describe('<PaginationPageInput />', () => {
|
|
32
32
|
it('should render', async () => {
|
|
33
33
|
const defaultOnChange = vi.fn();
|
|
34
|
-
render(
|
|
34
|
+
render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
35
35
|
numberOfPages: 10,
|
|
36
36
|
currentPageIndex: 0,
|
|
37
37
|
onChange: defaultOnChange,
|
|
@@ -43,7 +43,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
43
43
|
});
|
|
44
44
|
it('should display the current page number', async () => {
|
|
45
45
|
const defaultOnChange = vi.fn();
|
|
46
|
-
render(
|
|
46
|
+
render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
47
47
|
numberOfPages: 10,
|
|
48
48
|
currentPageIndex: 3,
|
|
49
49
|
onChange: defaultOnChange,
|
|
@@ -54,7 +54,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
54
54
|
});
|
|
55
55
|
it('should correctly update page number', async () => {
|
|
56
56
|
const defaultOnChange = vi.fn();
|
|
57
|
-
const _render = render(
|
|
57
|
+
const _render = render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
58
58
|
numberOfPages: 10,
|
|
59
59
|
currentPageIndex: 3,
|
|
60
60
|
onChange: defaultOnChange,
|
|
@@ -65,7 +65,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
65
65
|
expect(input).toHaveAttribute('value', '4');
|
|
66
66
|
|
|
67
67
|
// Set currentPageIndex: 6
|
|
68
|
-
rerender(
|
|
68
|
+
rerender(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
69
69
|
numberOfPages: 10,
|
|
70
70
|
currentPageIndex: 6,
|
|
71
71
|
onChange: defaultOnChange,
|
|
@@ -75,7 +75,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
75
75
|
});
|
|
76
76
|
it("shouldn't display the arrow keys of NumberInput", async () => {
|
|
77
77
|
const defaultOnChange = vi.fn();
|
|
78
|
-
const _render2 = render(
|
|
78
|
+
const _render2 = render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
79
79
|
numberOfPages: 10,
|
|
80
80
|
currentPageIndex: 3,
|
|
81
81
|
onChange: defaultOnChange,
|
|
@@ -89,7 +89,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
89
89
|
});
|
|
90
90
|
it("should disable the input on 'disabled'", async () => {
|
|
91
91
|
const defaultOnChange = vi.fn();
|
|
92
|
-
render(
|
|
92
|
+
render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
93
93
|
numberOfPages: 10,
|
|
94
94
|
currentPageIndex: 3,
|
|
95
95
|
onChange: defaultOnChange,
|
|
@@ -101,7 +101,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
101
101
|
});
|
|
102
102
|
it('should set the ScreenReaderLabel for the input', async () => {
|
|
103
103
|
const defaultOnChange = vi.fn();
|
|
104
|
-
const _render3 = render(
|
|
104
|
+
const _render3 = render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
105
105
|
numberOfPages: 10,
|
|
106
106
|
currentPageIndex: 3,
|
|
107
107
|
onChange: defaultOnChange,
|
|
@@ -113,7 +113,7 @@ describe('<PaginationPageInput />', () => {
|
|
|
113
113
|
});
|
|
114
114
|
it('should display the number of pages in the label', async () => {
|
|
115
115
|
const defaultOnChange = vi.fn();
|
|
116
|
-
const _render4 = render(
|
|
116
|
+
const _render4 = render(/*#__PURE__*/React.createElement(PaginationPageInput, {
|
|
117
117
|
numberOfPages: 10,
|
|
118
118
|
currentPageIndex: 3,
|
|
119
119
|
onChange: defaultOnChange,
|
|
@@ -52,7 +52,7 @@ describe('<Pagination />', () => {
|
|
|
52
52
|
consoleErrorMock.mockRestore();
|
|
53
53
|
});
|
|
54
54
|
it('should render all pages buttons', async () => {
|
|
55
|
-
render(
|
|
55
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
56
56
|
variant: "compact"
|
|
57
57
|
}, buildPages(5)));
|
|
58
58
|
const buttons = screen.getAllByRole('button');
|
|
@@ -62,7 +62,7 @@ describe('<Pagination />', () => {
|
|
|
62
62
|
});
|
|
63
63
|
describe('with 5 or less pages', () => {
|
|
64
64
|
it('should not render next/prev buttons', async () => {
|
|
65
|
-
render(
|
|
65
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
66
66
|
label: "Example",
|
|
67
67
|
variant: "compact",
|
|
68
68
|
labelNext: "Next",
|
|
@@ -76,7 +76,7 @@ describe('<Pagination />', () => {
|
|
|
76
76
|
expect(prevButton).not.toBeInTheDocument();
|
|
77
77
|
});
|
|
78
78
|
it('should not render first/last buttons', async () => {
|
|
79
|
-
render(
|
|
79
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
80
80
|
label: "Example",
|
|
81
81
|
variant: "compact",
|
|
82
82
|
labelNext: "Next",
|
|
@@ -95,7 +95,7 @@ describe('<Pagination />', () => {
|
|
|
95
95
|
});
|
|
96
96
|
describe('should meet a11y standards', () => {
|
|
97
97
|
it('by default', async () => {
|
|
98
|
-
const _render = render(
|
|
98
|
+
const _render = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
99
99
|
variant: "compact",
|
|
100
100
|
labelNext: "Next",
|
|
101
101
|
labelPrev: "Prev"
|
|
@@ -105,7 +105,7 @@ describe('<Pagination />', () => {
|
|
|
105
105
|
expect(axeCheck).toBe(true);
|
|
106
106
|
});
|
|
107
107
|
it('by default with more pages', async () => {
|
|
108
|
-
const _render2 = render(
|
|
108
|
+
const _render2 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
109
109
|
variant: "compact",
|
|
110
110
|
labelNext: "Next",
|
|
111
111
|
labelPrev: "Prev"
|
|
@@ -115,7 +115,7 @@ describe('<Pagination />', () => {
|
|
|
115
115
|
expect(axeCheck).toBe(true);
|
|
116
116
|
});
|
|
117
117
|
it('with first/last arrows', async () => {
|
|
118
|
-
const _render3 = render(
|
|
118
|
+
const _render3 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
119
119
|
variant: "compact",
|
|
120
120
|
labelNext: "Next",
|
|
121
121
|
labelPrev: "Prev",
|
|
@@ -128,7 +128,7 @@ describe('<Pagination />', () => {
|
|
|
128
128
|
expect(axeCheck).toBe(true);
|
|
129
129
|
});
|
|
130
130
|
it('with disabled arrows', async () => {
|
|
131
|
-
const _render4 = render(
|
|
131
|
+
const _render4 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
132
132
|
variant: "compact",
|
|
133
133
|
labelNext: "Next",
|
|
134
134
|
labelPrev: "Prev",
|
|
@@ -143,7 +143,7 @@ describe('<Pagination />', () => {
|
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
145
|
it('should render page buttons', async () => {
|
|
146
|
-
render(
|
|
146
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
147
147
|
variant: "compact",
|
|
148
148
|
labelNext: "Next",
|
|
149
149
|
labelPrev: "Prev"
|
|
@@ -154,7 +154,7 @@ describe('<Pagination />', () => {
|
|
|
154
154
|
expect(pagination).toHaveTextContent('#0#1#2#3#4');
|
|
155
155
|
});
|
|
156
156
|
it('should render a single page button', async () => {
|
|
157
|
-
render(
|
|
157
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
158
158
|
variant: "compact",
|
|
159
159
|
labelNext: "Next",
|
|
160
160
|
labelPrev: "Prev"
|
|
@@ -176,7 +176,7 @@ describe('<Pagination />', () => {
|
|
|
176
176
|
expect(buttons.length).toEqual(0);
|
|
177
177
|
});
|
|
178
178
|
it('should truncate pages to context', async () => {
|
|
179
|
-
render(
|
|
179
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
180
180
|
variant: "compact",
|
|
181
181
|
labelNext: "Next",
|
|
182
182
|
labelPrev: "Prev"
|
|
@@ -196,7 +196,7 @@ describe('<Pagination />', () => {
|
|
|
196
196
|
expect(ellipses.length).toEqual(2);
|
|
197
197
|
});
|
|
198
198
|
it('should truncate start', async () => {
|
|
199
|
-
render(
|
|
199
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
200
200
|
variant: "compact",
|
|
201
201
|
labelNext: "Next",
|
|
202
202
|
labelPrev: "Prev"
|
|
@@ -216,7 +216,7 @@ describe('<Pagination />', () => {
|
|
|
216
216
|
expect(ellipses.length).toEqual(1);
|
|
217
217
|
});
|
|
218
218
|
it('should truncate end', async () => {
|
|
219
|
-
render(
|
|
219
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
220
220
|
variant: "compact",
|
|
221
221
|
labelNext: "Next",
|
|
222
222
|
labelPrev: "Prev"
|
|
@@ -236,7 +236,7 @@ describe('<Pagination />', () => {
|
|
|
236
236
|
expect(ellipses.length).toEqual(1);
|
|
237
237
|
});
|
|
238
238
|
it('should omit ellipses when bounds included in context', async () => {
|
|
239
|
-
render(
|
|
239
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
240
240
|
variant: "compact",
|
|
241
241
|
labelNext: "Next",
|
|
242
242
|
labelPrev: "Prev"
|
|
@@ -257,7 +257,7 @@ describe('<Pagination />', () => {
|
|
|
257
257
|
});
|
|
258
258
|
describe('when updating with the FIRST page becoming current', () => {
|
|
259
259
|
it('should move focus from the Previous Page button to the first page button', async () => {
|
|
260
|
-
const _render5 = render(
|
|
260
|
+
const _render5 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
261
261
|
variant: "compact",
|
|
262
262
|
labelNext: "Next",
|
|
263
263
|
labelPrev: "Previous"
|
|
@@ -270,7 +270,7 @@ describe('<Pagination />', () => {
|
|
|
270
270
|
expect(prevButton).toHaveFocus();
|
|
271
271
|
|
|
272
272
|
// Set children: buildPages(7, 0)
|
|
273
|
-
rerender(
|
|
273
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
274
274
|
variant: "compact",
|
|
275
275
|
labelNext: "Next",
|
|
276
276
|
labelPrev: "Previous"
|
|
@@ -281,7 +281,7 @@ describe('<Pagination />', () => {
|
|
|
281
281
|
expect(button0).toHaveFocus();
|
|
282
282
|
});
|
|
283
283
|
it('should move focus from the First Page button to the first page button', async () => {
|
|
284
|
-
const _render6 = render(
|
|
284
|
+
const _render6 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
285
285
|
variant: "compact",
|
|
286
286
|
labelNext: "Next",
|
|
287
287
|
labelPrev: "Previous",
|
|
@@ -297,7 +297,7 @@ describe('<Pagination />', () => {
|
|
|
297
297
|
expect(firstButton).toHaveFocus();
|
|
298
298
|
|
|
299
299
|
// Set children: buildPages(7, 0)
|
|
300
|
-
rerender(
|
|
300
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
301
301
|
variant: "compact",
|
|
302
302
|
labelNext: "Next",
|
|
303
303
|
labelPrev: "Previous",
|
|
@@ -311,7 +311,7 @@ describe('<Pagination />', () => {
|
|
|
311
311
|
expect(button0).toHaveFocus();
|
|
312
312
|
});
|
|
313
313
|
it('should not change focus when the Previous Page button did not have focus', async () => {
|
|
314
|
-
const _render7 = render(
|
|
314
|
+
const _render7 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
315
315
|
variant: "compact",
|
|
316
316
|
labelNext: "Next",
|
|
317
317
|
labelPrev: "Previous"
|
|
@@ -322,7 +322,7 @@ describe('<Pagination />', () => {
|
|
|
322
322
|
});
|
|
323
323
|
button1.focus();
|
|
324
324
|
expect(button1).toHaveFocus();
|
|
325
|
-
rerender(
|
|
325
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
326
326
|
variant: "compact",
|
|
327
327
|
labelNext: "Next",
|
|
328
328
|
labelPrev: "Previous"
|
|
@@ -330,7 +330,7 @@ describe('<Pagination />', () => {
|
|
|
330
330
|
expect(button1).toHaveFocus();
|
|
331
331
|
});
|
|
332
332
|
it('should not change focus when the First Page button did not have focus', async () => {
|
|
333
|
-
const _render8 = render(
|
|
333
|
+
const _render8 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
334
334
|
variant: "compact",
|
|
335
335
|
labelNext: "Next",
|
|
336
336
|
labelPrev: "Previous",
|
|
@@ -344,7 +344,7 @@ describe('<Pagination />', () => {
|
|
|
344
344
|
});
|
|
345
345
|
button1.focus();
|
|
346
346
|
expect(button1).toHaveFocus();
|
|
347
|
-
rerender(
|
|
347
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
348
348
|
variant: "compact",
|
|
349
349
|
labelNext: "Next",
|
|
350
350
|
labelPrev: "Previous",
|
|
@@ -355,7 +355,7 @@ describe('<Pagination />', () => {
|
|
|
355
355
|
expect(button1).toHaveFocus();
|
|
356
356
|
});
|
|
357
357
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
358
|
-
const _render9 = render(
|
|
358
|
+
const _render9 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
359
359
|
variant: "compact",
|
|
360
360
|
labelNext: "Next",
|
|
361
361
|
labelPrev: "Previous"
|
|
@@ -368,7 +368,7 @@ describe('<Pagination />', () => {
|
|
|
368
368
|
expect(prevButton).toHaveFocus();
|
|
369
369
|
|
|
370
370
|
// Set children: buildPages(7, 0)
|
|
371
|
-
rerender(
|
|
371
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
372
372
|
variant: "compact",
|
|
373
373
|
labelNext: "Next",
|
|
374
374
|
labelPrev: "Previous"
|
|
@@ -380,7 +380,7 @@ describe('<Pagination />', () => {
|
|
|
380
380
|
expect(button1).toHaveFocus();
|
|
381
381
|
|
|
382
382
|
// Set children: buildPages(7, 0)
|
|
383
|
-
rerender(
|
|
383
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
384
384
|
variant: "compact",
|
|
385
385
|
labelNext: "Next",
|
|
386
386
|
labelPrev: "Previous"
|
|
@@ -390,7 +390,7 @@ describe('<Pagination />', () => {
|
|
|
390
390
|
});
|
|
391
391
|
describe('when updating with the LAST page becoming current', () => {
|
|
392
392
|
it('should move focus from the Next Page button to the last page button', async () => {
|
|
393
|
-
const _render10 = render(
|
|
393
|
+
const _render10 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
394
394
|
variant: "compact",
|
|
395
395
|
labelNext: "Next",
|
|
396
396
|
labelPrev: "Previous"
|
|
@@ -403,7 +403,7 @@ describe('<Pagination />', () => {
|
|
|
403
403
|
expect(nextButton).toHaveFocus();
|
|
404
404
|
|
|
405
405
|
// Set children: buildPages(7, 6)
|
|
406
|
-
rerender(
|
|
406
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
407
407
|
variant: "compact",
|
|
408
408
|
labelNext: "Next",
|
|
409
409
|
labelPrev: "Previous"
|
|
@@ -414,7 +414,7 @@ describe('<Pagination />', () => {
|
|
|
414
414
|
expect(button6).toHaveFocus();
|
|
415
415
|
});
|
|
416
416
|
it('should move focus from the Last Page button to the last page button', async () => {
|
|
417
|
-
const _render11 = render(
|
|
417
|
+
const _render11 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
418
418
|
variant: "compact",
|
|
419
419
|
labelNext: "Next",
|
|
420
420
|
labelPrev: "Previous",
|
|
@@ -430,7 +430,7 @@ describe('<Pagination />', () => {
|
|
|
430
430
|
expect(lastButton).toHaveFocus();
|
|
431
431
|
|
|
432
432
|
// Set children: buildPages(7, 6)
|
|
433
|
-
rerender(
|
|
433
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
434
434
|
variant: "compact",
|
|
435
435
|
labelNext: "Next",
|
|
436
436
|
labelPrev: "Previous",
|
|
@@ -444,7 +444,7 @@ describe('<Pagination />', () => {
|
|
|
444
444
|
expect(button6).toHaveFocus();
|
|
445
445
|
});
|
|
446
446
|
it('should not change focus when the Next Page button did not have focus', async () => {
|
|
447
|
-
const _render12 = render(
|
|
447
|
+
const _render12 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
448
448
|
variant: "compact",
|
|
449
449
|
labelNext: "Next",
|
|
450
450
|
labelPrev: "Previous"
|
|
@@ -457,7 +457,7 @@ describe('<Pagination />', () => {
|
|
|
457
457
|
expect(button5).toHaveFocus();
|
|
458
458
|
|
|
459
459
|
// Set children: buildPages(7, 5)
|
|
460
|
-
rerender(
|
|
460
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
461
461
|
variant: "compact",
|
|
462
462
|
labelNext: "Next",
|
|
463
463
|
labelPrev: "Previous"
|
|
@@ -465,7 +465,7 @@ describe('<Pagination />', () => {
|
|
|
465
465
|
expect(button5).toHaveFocus();
|
|
466
466
|
});
|
|
467
467
|
it('should not change focus when the Last Page button did not have focus', async () => {
|
|
468
|
-
const _render13 = render(
|
|
468
|
+
const _render13 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
469
469
|
variant: "compact",
|
|
470
470
|
labelNext: "Next",
|
|
471
471
|
labelPrev: "Previous",
|
|
@@ -481,7 +481,7 @@ describe('<Pagination />', () => {
|
|
|
481
481
|
expect(button5).toHaveFocus();
|
|
482
482
|
|
|
483
483
|
// Set children: buildPages(7, 6)
|
|
484
|
-
rerender(
|
|
484
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
485
485
|
variant: "compact",
|
|
486
486
|
labelNext: "Next",
|
|
487
487
|
labelPrev: "Previous",
|
|
@@ -492,7 +492,7 @@ describe('<Pagination />', () => {
|
|
|
492
492
|
expect(button5).toHaveFocus();
|
|
493
493
|
});
|
|
494
494
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
495
|
-
const _render14 = render(
|
|
495
|
+
const _render14 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
496
496
|
variant: "compact",
|
|
497
497
|
labelNext: "Next",
|
|
498
498
|
labelPrev: "Previous"
|
|
@@ -505,7 +505,7 @@ describe('<Pagination />', () => {
|
|
|
505
505
|
expect(nextButton).toHaveFocus();
|
|
506
506
|
|
|
507
507
|
// Set children: buildPages(7, 6)
|
|
508
|
-
rerender(
|
|
508
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
509
509
|
variant: "compact",
|
|
510
510
|
labelNext: "Next",
|
|
511
511
|
labelPrev: "Previous"
|
|
@@ -517,7 +517,7 @@ describe('<Pagination />', () => {
|
|
|
517
517
|
expect(button5).toHaveFocus();
|
|
518
518
|
|
|
519
519
|
// Set children: buildPages(7, 6)
|
|
520
|
-
rerender(
|
|
520
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
521
521
|
variant: "compact",
|
|
522
522
|
labelNext: "Next",
|
|
523
523
|
labelPrev: "Previous"
|
|
@@ -528,7 +528,7 @@ describe('<Pagination />', () => {
|
|
|
528
528
|
describe('arrows', () => {
|
|
529
529
|
describe('should render', () => {
|
|
530
530
|
it('only the stepper arrows when available', async () => {
|
|
531
|
-
const _render15 = render(
|
|
531
|
+
const _render15 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
532
532
|
variant: "compact",
|
|
533
533
|
labelNext: "Next",
|
|
534
534
|
labelPrev: "Previous"
|
|
@@ -544,7 +544,7 @@ describe('<Pagination />', () => {
|
|
|
544
544
|
expect(nextButton).toBeInTheDocument();
|
|
545
545
|
|
|
546
546
|
// Set children: buildPages(6, 5)
|
|
547
|
-
rerender(
|
|
547
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
548
548
|
variant: "compact",
|
|
549
549
|
labelNext: "Next",
|
|
550
550
|
labelPrev: "Previous"
|
|
@@ -559,7 +559,7 @@ describe('<Pagination />', () => {
|
|
|
559
559
|
expect(nextButtonUpdated).not.toBeInTheDocument();
|
|
560
560
|
});
|
|
561
561
|
it('the First and Last arrows withFirstAndLastButton', async () => {
|
|
562
|
-
const _render16 = render(
|
|
562
|
+
const _render16 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
563
563
|
variant: "compact",
|
|
564
564
|
labelNext: "Next",
|
|
565
565
|
labelPrev: "Previous",
|
|
@@ -578,7 +578,7 @@ describe('<Pagination />', () => {
|
|
|
578
578
|
expect(lastButton).toBeInTheDocument();
|
|
579
579
|
|
|
580
580
|
// Set children: buildPages(6, 5)
|
|
581
|
-
rerender(
|
|
581
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
582
582
|
variant: "compact",
|
|
583
583
|
labelNext: "Next",
|
|
584
584
|
labelPrev: "Previous",
|
|
@@ -596,7 +596,7 @@ describe('<Pagination />', () => {
|
|
|
596
596
|
expect(lastButtonUpdated).not.toBeInTheDocument();
|
|
597
597
|
});
|
|
598
598
|
it('the disabled arrows with showDisabledButtons', async () => {
|
|
599
|
-
const _render17 = render(
|
|
599
|
+
const _render17 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
600
600
|
variant: "compact",
|
|
601
601
|
labelNext: "Next",
|
|
602
602
|
labelPrev: "Previous",
|
|
@@ -625,7 +625,7 @@ describe('<Pagination />', () => {
|
|
|
625
625
|
|
|
626
626
|
// Go to last item
|
|
627
627
|
// Set children: buildPages(6, 5)
|
|
628
|
-
rerender(
|
|
628
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
629
629
|
variant: "compact",
|
|
630
630
|
labelNext: "Next",
|
|
631
631
|
labelPrev: "Previous",
|
|
@@ -653,7 +653,7 @@ describe('<Pagination />', () => {
|
|
|
653
653
|
});
|
|
654
654
|
});
|
|
655
655
|
it('should not continue to change focus on subsequent updates', async () => {
|
|
656
|
-
const _render18 = render(
|
|
656
|
+
const _render18 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
657
657
|
variant: "compact",
|
|
658
658
|
labelNext: "Next",
|
|
659
659
|
labelPrev: "Previous"
|
|
@@ -669,7 +669,7 @@ describe('<Pagination />', () => {
|
|
|
669
669
|
expect(nextButton).toBeInTheDocument();
|
|
670
670
|
|
|
671
671
|
// Set children: buildPages(6, 5)
|
|
672
|
-
rerender(
|
|
672
|
+
rerender(/*#__PURE__*/React.createElement(Pagination, {
|
|
673
673
|
variant: "compact",
|
|
674
674
|
labelNext: "Next",
|
|
675
675
|
labelPrev: "Previous"
|
|
@@ -695,7 +695,7 @@ describe('<Pagination />', () => {
|
|
|
695
695
|
const props = {
|
|
696
696
|
[prop]: 'foo'
|
|
697
697
|
};
|
|
698
|
-
render(
|
|
698
|
+
render(/*#__PURE__*/React.createElement(Pagination, Object.assign({
|
|
699
699
|
variant: "compact",
|
|
700
700
|
labelNext: "Next",
|
|
701
701
|
labelPrev: "Previous"
|
|
@@ -709,7 +709,7 @@ describe('<Pagination />', () => {
|
|
|
709
709
|
const props = {
|
|
710
710
|
[prop]: allowedProps[prop]
|
|
711
711
|
};
|
|
712
|
-
render(
|
|
712
|
+
render(/*#__PURE__*/React.createElement(Pagination, Object.assign({
|
|
713
713
|
variant: "compact",
|
|
714
714
|
labelNext: "Next",
|
|
715
715
|
labelPrev: "Previous"
|
|
@@ -723,7 +723,7 @@ describe('<Pagination />', () => {
|
|
|
723
723
|
});
|
|
724
724
|
it(`should pass down the elementRef prop`, async () => {
|
|
725
725
|
const elementRef = vi.fn();
|
|
726
|
-
const _render19 = render(
|
|
726
|
+
const _render19 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
727
727
|
elementRef: elementRef,
|
|
728
728
|
variant: "compact",
|
|
729
729
|
labelNext: "Next",
|
|
@@ -734,7 +734,7 @@ describe('<Pagination />', () => {
|
|
|
734
734
|
});
|
|
735
735
|
it('should navigate to adjacent pages', async () => {
|
|
736
736
|
const onClick = vi.fn();
|
|
737
|
-
render(
|
|
737
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
738
738
|
variant: "compact",
|
|
739
739
|
labelNext: "Next",
|
|
740
740
|
labelPrev: "Previous"
|
|
@@ -753,7 +753,7 @@ describe('<Pagination />', () => {
|
|
|
753
753
|
});
|
|
754
754
|
describe('input variant', () => {
|
|
755
755
|
it('should display number input', async () => {
|
|
756
|
-
const _render20 = render(
|
|
756
|
+
const _render20 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
757
757
|
variant: "input",
|
|
758
758
|
labelNext: "Next",
|
|
759
759
|
labelPrev: "Previous",
|
|
@@ -765,7 +765,7 @@ describe('<Pagination />', () => {
|
|
|
765
765
|
expect(numberInput).toHaveValue(3);
|
|
766
766
|
});
|
|
767
767
|
it('should display all arrow buttons', async () => {
|
|
768
|
-
render(
|
|
768
|
+
render(/*#__PURE__*/React.createElement(Pagination, {
|
|
769
769
|
variant: "input",
|
|
770
770
|
labelNext: "Next",
|
|
771
771
|
labelPrev: "Prev",
|
|
@@ -790,7 +790,7 @@ describe('<Pagination />', () => {
|
|
|
790
790
|
expect(lastButton).toBeVisible();
|
|
791
791
|
});
|
|
792
792
|
it('should pass label', async () => {
|
|
793
|
-
const _render21 = render(
|
|
793
|
+
const _render21 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
794
794
|
variant: "input",
|
|
795
795
|
labelNext: "Next",
|
|
796
796
|
labelPrev: "Previous",
|
|
@@ -802,7 +802,7 @@ describe('<Pagination />', () => {
|
|
|
802
802
|
expect(container).toHaveTextContent('custom-input-label: 6');
|
|
803
803
|
});
|
|
804
804
|
it('should pass ScreenReaderLabel', async () => {
|
|
805
|
-
const _render22 = render(
|
|
805
|
+
const _render22 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
806
806
|
variant: "input",
|
|
807
807
|
labelNext: "Next",
|
|
808
808
|
labelPrev: "Previous",
|
|
@@ -816,7 +816,7 @@ describe('<Pagination />', () => {
|
|
|
816
816
|
it('should change pages on input change', async () => {
|
|
817
817
|
const onClick1 = vi.fn();
|
|
818
818
|
const onClick2 = vi.fn();
|
|
819
|
-
const _render23 = render(
|
|
819
|
+
const _render23 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
820
820
|
variant: "input",
|
|
821
821
|
labelNext: "Next",
|
|
822
822
|
labelPrev: "Previous",
|
|
@@ -940,7 +940,7 @@ describe('<Pagination />', () => {
|
|
|
940
940
|
});
|
|
941
941
|
it('should render custom buttons', () => {
|
|
942
942
|
const pageMap = ['A-G', 'H-J', 'K-M', 'N-Q', 'R-Z'];
|
|
943
|
-
const _render32 = render(
|
|
943
|
+
const _render32 = render(/*#__PURE__*/React.createElement(Pagination, {
|
|
944
944
|
variant: "full",
|
|
945
945
|
labelNext: "Next Page",
|
|
946
946
|
labelPrev: "Previous Page",
|
|
@@ -43,7 +43,7 @@ describe('<PaginationArrowButton />', () => {
|
|
|
43
43
|
});
|
|
44
44
|
it('should provide a ref to the button element', async () => {
|
|
45
45
|
const buttonRef = _vitest.vi.fn();
|
|
46
|
-
(0, _react2.render)(
|
|
46
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationArrowButton, {
|
|
47
47
|
direction: "prev",
|
|
48
48
|
label: "Label",
|
|
49
49
|
buttonRef: buttonRef
|
|
@@ -42,7 +42,7 @@ describe('<PaginationButton />', () => {
|
|
|
42
42
|
});
|
|
43
43
|
it('should navigate using button when onClick provided', async () => {
|
|
44
44
|
const onClick = _vitest.vi.fn();
|
|
45
|
-
(0, _react2.render)(
|
|
45
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationButton, {
|
|
46
46
|
onClick: onClick
|
|
47
47
|
}, "1"));
|
|
48
48
|
const button = _react2.screen.getByRole('button', {
|
|
@@ -55,7 +55,7 @@ describe('<PaginationButton />', () => {
|
|
|
55
55
|
});
|
|
56
56
|
it('should disable navigation to current page', async () => {
|
|
57
57
|
const onClick = _vitest.vi.fn();
|
|
58
|
-
(0, _react2.render)(
|
|
58
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.PaginationButton, {
|
|
59
59
|
onClick: onClick,
|
|
60
60
|
current: true
|
|
61
61
|
}, "1"));
|