6b153192a3
After migrating to eslint some errors were disabled to make it easier to migrate. This enables all the lint rules and treats all warnings as a build failure. Similarly, CI won't automatically try to fix mistakes. Change-Id: I80f808af026fc51bed90421b3b24737994a52094
40 lines
951 B
TypeScript
40 lines
951 B
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 update(_user: UpdatedUser): Promise<void> {
|
|
throw new Error('not implemented');
|
|
}
|
|
|
|
public enableUserMFA(_: string): Promise<void> {
|
|
return Promise.resolve();
|
|
}
|
|
|
|
public disableUserMFA(_: string): Promise<void> {
|
|
return Promise.resolve();
|
|
}
|
|
|
|
public generateUserMFASecret(): Promise<string> {
|
|
return Promise.resolve('test');
|
|
}
|
|
|
|
public generateUserMFARecoveryCodes(): Promise<string[]> {
|
|
return Promise.resolve(['test', 'test1', 'test2']);
|
|
}
|
|
}
|