2019-08-30 12:34:51 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2021-07-20 12:34:40 +01:00
|
|
|
import { UpdatedUser, User, UsersApi } from '@/types/users';
|
2019-08-30 12:34:51 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
public update(_user: UpdatedUser): Promise<void> {
|
2019-08-30 12:34:51 +01:00
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
2021-07-08 17:43:09 +01:00
|
|
|
|
2021-07-20 12:34:40 +01:00
|
|
|
public enableUserMFA(_: string): Promise<void> {
|
2021-07-08 17:43:09 +01:00
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
2021-07-14 15:38:53 +01:00
|
|
|
public disableUserMFA(_: string): Promise<void> {
|
2021-07-08 17:43:09 +01:00
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
2021-07-16 17:58:26 +01:00
|
|
|
public generateUserMFASecret(): Promise<string> {
|
|
|
|
return Promise.resolve('test');
|
|
|
|
}
|
|
|
|
|
2021-07-08 17:43:09 +01:00
|
|
|
public generateUserMFARecoveryCodes(): Promise<string[]> {
|
|
|
|
return Promise.resolve(['test', 'test1', 'test2']);
|
|
|
|
}
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|