Skip to content

Commit 7e63bbf

Browse files
fix: changed pagination label for select (#18166)
* fix: changed pagination label for select * fix: avt test cases --------- Co-authored-by: Gururaj J <89023023+Gururajj77@users.noreply.github.com>
1 parent dec8173 commit 7e63bbf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

e2e/components/Pagination/Pagination-test.avt.e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ test.describe('@avt Pagination', () => {
5050
name: 'Items per page:',
5151
});
5252
const pageSelector = page.getByRole('combobox', {
53-
name: 'Page number, of 11 pages',
53+
name: 'Page of 11 pages',
5454
});
5555
const updatedPageSelector = page.getByRole('combobox', {
56-
name: 'Page number, of 3 pages',
56+
name: 'Page of 3 pages',
5757
});
5858
const nextPageButton = page.getByRole('button', { name: 'Next page' });
5959
const prevPageButton = page.getByRole('button').first();

packages/react/src/components/Pagination/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ const Pagination = React.forwardRef(function Pagination(
388388
<Select
389389
id={`${prefix}-pagination-select-${inputId}-right`}
390390
className={`${prefix}--select__page-number`}
391-
labelText={`Page number, of ${totalPages} pages`}
391+
labelText={`Page of ${totalPages} pages`}
392392
inline
393393
hideLabel
394394
onChange={handlePageInputChange}

packages/react/src/components/Pagination/__tests__/Pagination-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('Pagination', () => {
118118
onChange={onChange}
119119
/>
120120
);
121-
await userEvent.selectOptions(screen.getByLabelText(/Page number/), '2');
121+
await userEvent.selectOptions(screen.getByLabelText(/Page/), '2');
122122
expect(onChange).toHaveBeenCalledTimes(1);
123123
expect(onChange).toHaveBeenCalledWith(
124124
expect.objectContaining({ page: 2 })
@@ -237,7 +237,7 @@ describe('Pagination', () => {
237237
);
238238
expect(screen.getByText('1–1 of 2 items')).toBeInTheDocument();
239239

240-
await userEvent.selectOptions(screen.getByLabelText(/Page number/), '2');
240+
await userEvent.selectOptions(screen.getByLabelText(/Page/), '2');
241241
expect(screen.getByText('2–2 of 2 items')).toBeInTheDocument();
242242
});
243243

0 commit comments

Comments
 (0)