-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make credentials storing more liberal
- Loading branch information
Showing
8 changed files
with
62 additions
and
158 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -62,44 +62,35 @@ describe('Can strip phone formatting characters', () => { | |
describe('prepareFormValuesForStorage()', () => { | ||
describe('handling credentials', () => { | ||
it('accepts for username only', () => { | ||
const values = prepareFormValuesForStorage( | ||
{ | ||
credentials: { username: '[email protected]' }, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}, | ||
true, | ||
); | ||
const values = prepareFormValuesForStorage({ | ||
credentials: { username: '[email protected]' }, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}); | ||
expect(values.credentials?.username).toBe('[email protected]'); | ||
}); | ||
it('accepts password only', () => { | ||
const values = prepareFormValuesForStorage( | ||
{ | ||
// @ts-ignore | ||
credentials: { password: '123456' }, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}, | ||
false, | ||
); | ||
const values = prepareFormValuesForStorage({ | ||
// @ts-ignore | ||
credentials: { password: '123456' }, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}); | ||
expect(values.credentials?.password).toBe('123456'); | ||
}); | ||
it('accepts username+password', () => { | ||
const inputCredentials = { username: '[email protected]', password: '123456' }; | ||
const values = prepareFormValuesForStorage( | ||
{ | ||
credentials: inputCredentials, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}, | ||
false, | ||
); | ||
const values = prepareFormValuesForStorage({ | ||
credentials: inputCredentials, | ||
// @ts-ignore | ||
creditCards: {}, | ||
// @ts-ignore | ||
identities: {}, | ||
}); | ||
expect(values.credentials).toEqual(inputCredentials); | ||
}); | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.