Skip to content

Commit 2126d9a

Browse files
fix: addressing pr comments
1 parent c2dd278 commit 2126d9a

6 files changed

Lines changed: 12 additions & 59 deletions

File tree

src/authz-module/audit-user/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ describe('AuditUserPage', () => {
254254
// Look for pagination controls
255255
expect(screen.getByRole('navigation', { name: /table pagination/i })).toBeInTheDocument();
256256
// Check that some users count is shown (format might vary)
257-
expect(screen.getByText(/showing.*users/i)).toBeInTheDocument();
257+
expect(screen.getByText(/showing/i)).toBeInTheDocument();
258258
});
259259
});
260260

src/authz-module/audit-user/utils.test.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/authz-module/audit-user/utils.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/authz-module/components/TableFooter/TableFooter.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('TableFooter', () => {
5555
it('displays correct showing text with current page items', () => {
5656
renderFooter();
5757

58-
expect(screen.getByText('Showing 3 of 42 users.')).toBeInTheDocument();
58+
expect(screen.getByText('Showing 3 of 42.')).toBeInTheDocument();
5959
});
6060

6161
it('displays showing text with different row count', () => {
@@ -70,7 +70,7 @@ describe('TableFooter', () => {
7070
itemCount: 100,
7171
});
7272

73-
expect(screen.getByText('Showing 5 of 100 users.')).toBeInTheDocument();
73+
expect(screen.getByText('Showing 5 of 100.')).toBeInTheDocument();
7474
});
7575

7676
it('displays showing text when on last page with fewer items', () => {
@@ -83,7 +83,7 @@ describe('TableFooter', () => {
8383
itemCount: 42,
8484
});
8585

86-
expect(screen.getByText('Showing 2 of 42 users.')).toBeInTheDocument();
86+
expect(screen.getByText('Showing 2 of 42.')).toBeInTheDocument();
8787
});
8888
});
8989

@@ -157,7 +157,7 @@ describe('TableFooter', () => {
157157
itemCount: 3,
158158
});
159159

160-
expect(screen.getByText('Showing 3 of 3 users.')).toBeInTheDocument();
160+
expect(screen.getByText('Showing 3 of 3.')).toBeInTheDocument();
161161

162162
const page1Button = screen.queryByRole('button', { name: /1 of 1/ });
163163
expect(page1Button).not.toBeInTheDocument();
@@ -174,7 +174,7 @@ describe('TableFooter', () => {
174174
},
175175
});
176176

177-
expect(screen.getByText('Showing 0 of 0 users.')).toBeInTheDocument();
177+
expect(screen.getByText('Showing 0 of 0.')).toBeInTheDocument();
178178
});
179179

180180
it('handles large page counts correctly', () => {
@@ -189,7 +189,7 @@ describe('TableFooter', () => {
189189

190190
const currentPageButton = screen.getByRole('button', { name: '6 of 10' });
191191
expect(currentPageButton).toBeInTheDocument();
192-
expect(screen.getByText('Showing 3 of 95 users.')).toBeInTheDocument();
192+
expect(screen.getByText('Showing 3 of 95.')).toBeInTheDocument();
193193
});
194194
});
195195
});

src/authz-module/components/TableFooter/TableFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Footer = () => {
1919
variant="reduced"
2020
currentPage={pageIndex + 1}
2121
pageCount={pageCount}
22-
paginationLabel="Table pagination"
22+
paginationLabel={formatMessage(messages['authz.table.footer.pagination.label'])}
2323
onPageSelect={(pageNum) => gotoPage(pageNum - 1)}
2424
/>
2525
</TableFooter>

src/authz-module/components/messages.ts

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -167,40 +167,10 @@ const messages = defineMessages({
167167
defaultMessage: 'View all permissions',
168168
description: 'Text for the link to view all permissions in the user table',
169169
},
170-
'authz.table.footer.items.showing.text': {
171-
id: 'authz.table.footer.items.showing.text',
172-
defaultMessage: 'Showing {pageSize} of {itemCount} users.',
173-
description: 'Message displayed when the user reaches the applied filters limit',
174-
},
175-
'authz.table.controlbar.clearFilters': {
176-
id: 'authz.table.controlbar.clearFilters',
177-
defaultMessage: 'Clear filters',
178-
description: 'Button to clear all active filters in the table',
179-
},
180-
'authz.table.controlbar.search': {
181-
id: 'authz.table.controlbar.search',
182-
defaultMessage: 'Search',
183-
description: 'Search placeholder for two specific fields',
184-
},
185-
'authz.table.controlbar.search.by.fields': {
186-
id: 'authz.table.controlbar.search.by.fields',
187-
defaultMessage: 'Search by {firstField} or {secondField}',
188-
description: 'Search placeholder for two specific fields',
189-
},
190-
'authz.table.controlbar.filterby.label': {
191-
id: 'authz.table.controlbar.filterby.label',
192-
defaultMessage: 'Filtered by: ',
193-
description: 'Label for active filters in the table',
194-
},
195-
'authz.table.controlbar.filters.limit.reached': {
196-
id: 'authz.table.controlbar.filters.limit.reached',
197-
defaultMessage: '10 filter limit reached. Remove one of the applied filters so you can select another one.',
198-
description: 'Message displayed when the user reaches the applied filters limit',
199-
},
200-
'authz.table.controlbar.filters.items.showing': {
201-
id: 'authz.table.controlbar.filters.items.showing',
202-
defaultMessage: 'Showing {current} of {total}.',
203-
description: 'Message displayed when the user reaches the applied filters limit',
170+
'authz.table.footer.pagination.label': {
171+
id: 'authz.table.footer.pagination.label',
172+
defaultMessage: 'Table pagination',
173+
description: 'Label for the table pagination controls',
204174
},
205175
});
206176

0 commit comments

Comments
 (0)