-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
990ad4e
commit 78fccf6
Showing
2 changed files
with
39 additions
and
55 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 |
---|---|---|
|
@@ -343,30 +343,6 @@ describe('account repo', () => { | |
}); | ||
}); | ||
|
||
describe('When searching by username', () => { | ||
const setup = async () => { | ||
const originalUsername = '[email protected]'; | ||
const partialLowerCaseUsername = '[email protected]'; | ||
const lowercaseUsername = '[email protected]'; | ||
const account = accountFactory.build({ username: originalUsername }); | ||
await em.persistAndFlush([account]); | ||
em.clear(); | ||
return { originalUsername, partialLowerCaseUsername, lowercaseUsername, account }; | ||
}; | ||
|
||
it('should find account by user name, ignoring case', async () => { | ||
const { originalUsername, partialLowerCaseUsername, lowercaseUsername } = await setup(); | ||
|
||
let [accounts] = await repo.searchByUsernameExactMatch(partialLowerCaseUsername); | ||
expect(accounts).toHaveLength(1); | ||
expect(accounts[0]).toEqual(expect.objectContaining({ username: originalUsername })); | ||
|
||
[accounts] = await repo.searchByUsernameExactMatch(lowercaseUsername); | ||
expect(accounts).toHaveLength(1); | ||
expect(accounts[0]).toEqual(expect.objectContaining({ username: originalUsername })); | ||
}); | ||
}); | ||
|
||
describe('When using wildcard', () => { | ||
const setup = async () => { | ||
const originalUsername = '[email protected]'; | ||
|
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