Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnvdl committed Apr 26, 2024
1 parent 1b028f7 commit 58123fb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/password/src/is-common.util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,40 @@ import { clearCommonPasswordsCache, isCommon } from './is-common.util';

describe('isCommon util', () => {
describe('isCommon', () => {

describe('default datasource', () => {

it('should return true if the given password is part of the 10000 most common passwords.', async () => {
strictEqual(await isCommon('12345'), true);
});

it('should return false if the given password is not part of the 10000 most common passwords.', async () => {
strictEqual(await isCommon('a bird in the sky'), false);
});

});

describe('10k datasource', () => {

it('should return true if the given password is part of the 100000 most common passwords.', async () => {
strictEqual(await isCommon('12345', 'TenMillionListTop10k'), true);
});

it('should return false if the given password is not part of the 100000 most common passwords.', async () => {
strictEqual(await isCommon('a bird in the sky', 'TenMillionListTop10k'), false);
});

});

describe('100k datasource', () => {

it('should return true if the given password is part of the 100000 most common passwords.', async () => {
strictEqual(await isCommon('Cinder', 'TenMillionListTop100k'), true);
});

it('should return false if the given password is not part of the 100000 most common passwords.', async () => {
strictEqual(await isCommon('a bird in the sky', 'TenMillionListTop100k'), false);
});

});

});

describe('clearCommonPasswordsCache', () => {

it('should not fail if it is empty', () => {
clearCommonPasswordsCache();
});

it('should not fail if it is full', async () => {
await isCommon('12345', 'TenMillionListTop10k');

clearCommonPasswordsCache();
});
});
Expand Down

0 comments on commit 58123fb

Please sign in to comment.