Skip to content

Commit b754ce1

Browse files
fix: addressing pr comments
1 parent 8878f3b commit b754ce1

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
@@ -174,7 +174,7 @@ describe('AuditUserPage', () => {
174174
// Look for pagination controls
175175
expect(screen.getByRole('navigation', { name: /table pagination/i })).toBeInTheDocument();
176176
// Check that some users count is shown (format might vary)
177-
expect(screen.getByText(/showing.*users/i)).toBeInTheDocument();
177+
expect(screen.getByText(/showing/i)).toBeInTheDocument();
178178
});
179179
});
180180

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
@@ -117,40 +117,10 @@ const messages = defineMessages({
117117
defaultMessage: 'View all permissions',
118118
description: 'Text for the link to view all permissions in the user table',
119119
},
120-
'authz.table.footer.items.showing.text': {
121-
id: 'authz.table.footer.items.showing.text',
122-
defaultMessage: 'Showing {pageSize} of {itemCount} users.',
123-
description: 'Message displayed when the user reaches the applied filters limit',
124-
},
125-
'authz.table.controlbar.clearFilters': {
126-
id: 'authz.table.controlbar.clearFilters',
127-
defaultMessage: 'Clear filters',
128-
description: 'Button to clear all active filters in the table',
129-
},
130-
'authz.table.controlbar.search': {
131-
id: 'authz.table.controlbar.search',
132-
defaultMessage: 'Search',
133-
description: 'Search placeholder for two specific fields',
134-
},
135-
'authz.table.controlbar.search.by.fields': {
136-
id: 'authz.table.controlbar.search.by.fields',
137-
defaultMessage: 'Search by {firstField} or {secondField}',
138-
description: 'Search placeholder for two specific fields',
139-
},
140-
'authz.table.controlbar.filterby.label': {
141-
id: 'authz.table.controlbar.filterby.label',
142-
defaultMessage: 'Filtered by: ',
143-
description: 'Label for active filters in the table',
144-
},
145-
'authz.table.controlbar.filters.limit.reached': {
146-
id: 'authz.table.controlbar.filters.limit.reached',
147-
defaultMessage: '10 filter limit reached. Remove one of the applied filters so you can select another one.',
148-
description: 'Message displayed when the user reaches the applied filters limit',
149-
},
150-
'authz.table.controlbar.filters.items.showing': {
151-
id: 'authz.table.controlbar.filters.items.showing',
152-
defaultMessage: 'Showing {current} of {total}.',
153-
description: 'Message displayed when the user reaches the applied filters limit',
120+
'authz.table.footer.pagination.label': {
121+
id: 'authz.table.footer.pagination.label',
122+
defaultMessage: 'Table pagination',
123+
description: 'Label for the table pagination controls',
154124
},
155125
});
156126

0 commit comments

Comments
 (0)