Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagination and placeholder fix - 2117 #2284

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,8 @@
"organizations": "Organizations",
"search": "search",
"filter": "filter",
"searchByName": "searchByName"
"searchByName": "searchByName",
"searchOrganizations": "Search organization"
},
"userSidebarOrg": {
"yourOrganizations": "Your Organizations",
Expand Down
1 change: 0 additions & 1 deletion src/components/PaginationList/PaginationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const PaginationList = ({
<Hidden smDown initialWidth={'lg'}>
<TablePagination
rowsPerPageOptions={[
-1,
5,
10,
30,
Expand Down
41 changes: 41 additions & 0 deletions src/screens/UserPortal/Organizations/Organizations.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,45 @@ describe('Testing Organizations Screen [User Portal]', () => {
settingsBtn.click();
});
});
test('Rows per Page values', async () => {
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<Organizations />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>,
);
await wait();
const dropdown = screen.getByTestId('table-pagination');
userEvent.click(dropdown);
expect(screen.getByText('5')).toBeInTheDocument();
expect(screen.getByText('10')).toBeInTheDocument();
expect(screen.getByText('30')).toBeInTheDocument();
expect(screen.getByText('All')).toBeInTheDocument();
});



test('Search input has correct placeholder text', async () => {
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<Organizations />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>,
);

await wait();

const searchInput = screen.getByPlaceholderText('Search organizations');
expect(searchInput).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion src/screens/UserPortal/Organizations/Organizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export default function organizations(): JSX.Element {
<div className="mt-4">
<InputGroup className={styles.maxWidth}>
<Form.Control
placeholder={t('searchUsers')}
placeholder={t('searchOrganizations')}
id="searchUserOrgs"
type="text"
className={`${styles.borderNone} ${styles.backgroundWhite}`}
Expand Down
Loading