fix(fe/client): fix missing method issue of mock client
This commit is contained in:
parent
2b8f3e561e
commit
5a44d9f125
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
// TODO: replace this with jest mocks
|
||||
import { Response, Quota } from "./";
|
||||
import { Response, Quota, Preferences } from "./";
|
||||
|
||||
export interface UsersClientResps {
|
||||
loginMockResp: Response;
|
||||
|
@ -16,6 +16,7 @@ export interface UsersClientResps {
|
|||
listRolesMockResp: Response;
|
||||
selfMockResp: Response;
|
||||
getCaptchaIDMockResp: Response;
|
||||
setPreferencesMockResp: Response;
|
||||
}
|
||||
|
||||
export const resps = {
|
||||
|
@ -100,6 +101,11 @@ export const resps = {
|
|||
id: "mockCaptchaID",
|
||||
},
|
||||
},
|
||||
setPreferencesMockResp: {
|
||||
status: 200,
|
||||
statusText: "",
|
||||
data: {},
|
||||
},
|
||||
};
|
||||
export class MockUsersClient {
|
||||
private url: string;
|
||||
|
@ -175,4 +181,8 @@ export class MockUsersClient {
|
|||
getCaptchaID = (): Promise<Response> => {
|
||||
return this.wrapPromise(this.resps.getCaptchaIDMockResp);
|
||||
};
|
||||
|
||||
setPreferences = (prefers: Preferences): Promise<Response> => {
|
||||
return this.wrapPromise(this.resps.setPreferencesMockResp);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue