mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Split AccountStorage and ForgotPasswordStorage (expiring now)
This commit is contained in:
@@ -3,10 +3,12 @@ import type {
|
||||
EmailPasswordData,
|
||||
} from '../../../../../../src/identity/interaction/email-password/storage/BaseAccountStore';
|
||||
import { BaseAccountStore } from '../../../../../../src/identity/interaction/email-password/storage/BaseAccountStore';
|
||||
import type { ExpiringStorage } from '../../../../../../src/storage/keyvalue/ExpiringStorage';
|
||||
import type { KeyValueStorage } from '../../../../../../src/storage/keyvalue/KeyValueStorage';
|
||||
|
||||
describe('A BaseAccountStore', (): void => {
|
||||
let storage: KeyValueStorage<string, EmailPasswordData>;
|
||||
let forgotPasswordStorage: ExpiringStorage<string, EmailPasswordData>;
|
||||
const saltRounds = 11;
|
||||
let store: BaseAccountStore;
|
||||
const email = 'test@test.com';
|
||||
@@ -22,7 +24,13 @@ describe('A BaseAccountStore', (): void => {
|
||||
delete: jest.fn((id: string): any => map.delete(id)),
|
||||
} as any;
|
||||
|
||||
store = new BaseAccountStore(storage, saltRounds);
|
||||
forgotPasswordStorage = {
|
||||
get: jest.fn((id: string): any => map.get(id)),
|
||||
set: jest.fn((id: string, value: any): any => map.set(id, value)),
|
||||
delete: jest.fn((id: string): any => map.delete(id)),
|
||||
} as any;
|
||||
|
||||
store = new BaseAccountStore(storage, forgotPasswordStorage, saltRounds);
|
||||
});
|
||||
|
||||
it('can create accounts.', async(): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user