mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
|
import { parseSecretRecoveryPhrase } from './parse-secret-recovery-phrase';
|
||
|
|
||
|
describe('parseSecretRecoveryPhrase', () => {
|
||
|
it('should handle a regular Secret Recovery Phrase', () => {
|
||
|
expect(parseSecretRecoveryPhrase('foo bar baz')).toStrictEqual(
|
||
|
'foo bar baz',
|
||
|
);
|
||
|
});
|
||
|
|
||
|
it('should handle a mixed-case Secret Recovery Phrase', () => {
|
||
|
expect(parseSecretRecoveryPhrase('FOO bAr baZ')).toStrictEqual(
|
||
|
'foo bar baz',
|
||
|
);
|
||
|
});
|
||
|
|
||
|
it('should handle an upper-case Secret Recovery Phrase', () => {
|
||
|
expect(parseSecretRecoveryPhrase('FOO BAR BAZ')).toStrictEqual(
|
||
|
'foo bar baz',
|
||
|
);
|
||
|
});
|
||
|
|
||
|
it('should trim extraneous whitespace from the given Secret Recovery Phrase', () => {
|
||
|
expect(parseSecretRecoveryPhrase(' foo bar baz ')).toStrictEqual(
|
||
|
'foo bar baz',
|
||
|
);
|
||
|
});
|
||
|
|
||
|
it('should return an empty string when given a whitespace-only string', () => {
|
||
|
expect(parseSecretRecoveryPhrase(' ')).toStrictEqual('');
|
||
|
});
|
||
|
|
||
|
it('should return an empty string when given a string with only symbols', () => {
|
||
|
expect(parseSecretRecoveryPhrase('$')).toStrictEqual('');
|
||
|
});
|
||
|
|
||
|
it('should return an empty string for both null and undefined', () => {
|
||
|
expect(parseSecretRecoveryPhrase(undefined)).toStrictEqual('');
|
||
|
expect(parseSecretRecoveryPhrase(null)).toStrictEqual('');
|
||
|
});
|
||
|
});
|