-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from adhocteam/274-allow-case-insensitive-search
Allow search to be case-insensitive
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,15 @@ describe('Admin Page', () => { | |
const users = [ | ||
{ | ||
id: 2, | ||
email: 'email', | ||
email: '[email protected]', | ||
name: undefined, | ||
homeRegionId: 1, | ||
role: 'Grantee Specialist', | ||
permissions: [], | ||
}, | ||
{ | ||
id: 3, | ||
email: 'email', | ||
email: '[email protected]', | ||
name: 'Harry Potter', | ||
homeRegionId: 1, | ||
role: 'Grantee Specialist', | ||
|
@@ -63,6 +63,23 @@ describe('Admin Page', () => { | |
expect(links[0]).toHaveTextContent('Harry Potter'); | ||
}); | ||
|
||
it('User list is filterable by email', async () => { | ||
const filter = await screen.findByLabelText('Filter Users'); | ||
userEvent.type(filter, '@hogwarts.com'); | ||
const sideNav = screen.getByTestId('sidenav'); | ||
const links = within(sideNav).getAllByRole('link'); | ||
expect(links.length).toBe(2); | ||
}); | ||
|
||
it('user filtering is case-insentive', async () => { | ||
const filter = await screen.findByLabelText('Filter Users'); | ||
userEvent.type(filter, 'harry'); | ||
const sideNav = screen.getByTestId('sidenav'); | ||
const links = within(sideNav).getAllByRole('link'); | ||
expect(links.length).toBe(1); | ||
expect(links[0]).toHaveTextContent('Harry Potter'); | ||
}); | ||
|
||
it('allows a user to be selected', async () => { | ||
const button = await screen.findByText('Harry Potter'); | ||
userEvent.click(button); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters