0e3e588718
added api call, user isFrozen status; new banner added; DashboardArea migrated to use composition api; Change-Id: Ia3fe68c2239064b2b729c6de14d7fc1dc8f4cf3b
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import { UpdatedUser, User, UsersApi } from '@/types/users';
|
|
|
|
/**
|
|
* Mock for UsersApi
|
|
*/
|
|
export class UsersApiMock implements UsersApi {
|
|
private mockUser: User;
|
|
|
|
public setMockUser(mockUser: User): void {
|
|
this.mockUser = mockUser;
|
|
}
|
|
|
|
public get(): Promise<User> {
|
|
return Promise.resolve(this.mockUser);
|
|
}
|
|
|
|
public getFrozenStatus(): Promise<boolean> {
|
|
return Promise.resolve(true);
|
|
}
|
|
|
|
public update(_user: UpdatedUser): Promise<void> {
|
|
throw new Error('not implemented');
|
|
}
|
|
|
|
public enableUserMFA(_: string): Promise<void> {
|
|
return Promise.resolve();
|
|
}
|
|
|
|
public disableUserMFA(_passcode: string, _recoveryCode: string): Promise<void> {
|
|
return Promise.resolve();
|
|
}
|
|
|
|
public generateUserMFASecret(): Promise<string> {
|
|
return Promise.resolve('test');
|
|
}
|
|
|
|
public generateUserMFARecoveryCodes(): Promise<string[]> {
|
|
return Promise.resolve(['test', 'test1', 'test2']);
|
|
}
|
|
}
|