From 174a3897d2eecb3822c6c68be9e6bd97e9a11b88 Mon Sep 17 00:00:00 2001 From: Amanuel Sisay Date: Tue, 28 Jul 2026 16:04:07 +0200 Subject: [PATCH 1/2] fix: correct pagination arrow finders when jumpToPage is set --- src/pagination/__tests__/pagination.test.tsx | 14 ++++++++++++++ src/test-utils/dom/pagination/index.ts | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/pagination/__tests__/pagination.test.tsx b/src/pagination/__tests__/pagination.test.tsx index 46f7d546bf..2c0db69bfa 100644 --- a/src/pagination/__tests__/pagination.test.tsx +++ b/src/pagination/__tests__/pagination.test.tsx @@ -334,6 +334,20 @@ describe('jump to page', () => { expect(wrapper.findJumpToPageButton()).toBeTruthy(); }); + test('findNextPageButton returns the next arrow when jumpToPage is present', () => { + const { wrapper } = renderPagination(); + + expect(wrapper.findNextPageButton()).not.toBeNull(); + expect(wrapper.findNextPageButton().getElement().tagName.toLowerCase()).toBe('button'); + }); + + test('findPreviousPageButton returns the previous arrow when jumpToPage is present', () => { + const { wrapper } = renderPagination(); + + expect(wrapper.findPreviousPageButton()).not.toBeNull(); + expect(wrapper.findPreviousPageButton().getElement().tagName.toLowerCase()).toBe('button'); + }); + test('should disable jump to page input and button when pagination is disabled', () => { const { wrapper } = renderPagination( diff --git a/src/test-utils/dom/pagination/index.ts b/src/test-utils/dom/pagination/index.ts index 024fcd4db2..ad779e638b 100644 --- a/src/test-utils/dom/pagination/index.ts +++ b/src/test-utils/dom/pagination/index.ts @@ -40,11 +40,11 @@ export default class PaginationWrapper extends ComponentWrapper { } findPreviousPageButton(): PaginationButtonWrapper { - return this.findComponent(`li:first-child .${styles.button}`, PaginationButtonWrapper)!; + return this.findComponent(`li:first-child .${styles.arrow}`, PaginationButtonWrapper)!; } findNextPageButton(): PaginationButtonWrapper { - return this.findComponent(`li:last-child .${styles.button}`, PaginationButtonWrapper)!; + return this.findComponent(`li:not(:first-child) .${styles.arrow}`, PaginationButtonWrapper)!; } /** From 0c8a321eed82ba5ca3707d9a373f38fe40e657ea Mon Sep 17 00:00:00 2001 From: Amanuel Sisay Date: Tue, 28 Jul 2026 17:24:30 +0200 Subject: [PATCH 2/2] chore: snapshot update --- .../__snapshots__/test-utils-selectors.test.tsx.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap b/src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap index c1d4fc8b09..16e98a9c41 100644 --- a/src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap +++ b/src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap @@ -493,6 +493,7 @@ exports[`test-utils selectors 1`] = ` "awsui_root_efqlv", ], "pagination": [ + "awsui_arrow_fvjdu", "awsui_button-current_fvjdu", "awsui_button_fvjdu", "awsui_jump-to-page-input_fvjdu",