fix(fe): fix utest issues
This commit is contained in:
parent
5ff6988e0d
commit
fbe8708718
5 changed files with 43 additions and 8 deletions
|
@ -70,6 +70,16 @@ describe("Login", () => {
|
|||
downloadSpeedLimit: 3,
|
||||
},
|
||||
captchaID: "",
|
||||
preferences: {
|
||||
bg: {
|
||||
url: "bgUrl",
|
||||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
},
|
||||
});
|
||||
|
||||
// panes
|
||||
|
|
|
@ -82,6 +82,16 @@ describe("State Manager", () => {
|
|||
},
|
||||
authed: true,
|
||||
captchaID: "",
|
||||
preferences: {
|
||||
bg: {
|
||||
url: "bgUrl",
|
||||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
},
|
||||
});
|
||||
|
||||
// admin
|
||||
|
@ -177,6 +187,16 @@ describe("State Manager", () => {
|
|||
usedSpace: mockSelfResp.data.usedSpace,
|
||||
authed: false,
|
||||
captchaID: "",
|
||||
preferences: {
|
||||
bg: {
|
||||
url: "bgUrl",
|
||||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
},
|
||||
});
|
||||
|
||||
// admin
|
||||
|
|
|
@ -24,8 +24,6 @@ export interface UIProps {
|
|||
position: string;
|
||||
align: string;
|
||||
};
|
||||
cssURL: string;
|
||||
lanPackURL: string;
|
||||
}
|
||||
export interface ICoreState {
|
||||
browser: BrowserProps;
|
||||
|
@ -70,6 +68,16 @@ export function initState(): ICoreState {
|
|||
},
|
||||
authed: false,
|
||||
captchaID: "",
|
||||
preferences: {
|
||||
bg: {
|
||||
url: "",
|
||||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
}
|
||||
},
|
||||
admin: {
|
||||
users: Map<string, User>(),
|
||||
|
@ -89,8 +97,6 @@ export function initState(): ICoreState {
|
|||
position: "",
|
||||
align: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { ICoreState, MsgProps } from "./core_state";
|
|||
import { Flexbox } from "./layout/flexbox";
|
||||
import { updater } from "./state_updater";
|
||||
import { alertMsg } from "../common/env";
|
||||
import { Quota } from "../client";
|
||||
import { Quota, Preferences } from "../client";
|
||||
|
||||
export interface LoginProps {
|
||||
userID: string;
|
||||
|
@ -15,6 +15,7 @@ export interface LoginProps {
|
|||
quota: Quota;
|
||||
authed: boolean;
|
||||
captchaID: string;
|
||||
preferences: Preferences;
|
||||
}
|
||||
|
||||
export interface Props {
|
||||
|
|
|
@ -387,9 +387,7 @@ export class Updater {
|
|||
this.props.login.userRole = resp.data.role;
|
||||
this.props.login.usedSpace = resp.data.usedSpace;
|
||||
this.props.login.quota = resp.data.quota;
|
||||
this.props.ui.bg = resp.data.preferences.bg;
|
||||
this.props.ui.cssURL = resp.data.preferences.cssURL;
|
||||
this.props.ui.lanPackURL = resp.data.preferences.lanPackURL;
|
||||
this.props.login.preferences = resp.data.preferences;
|
||||
return true;
|
||||
}
|
||||
this.resetUser();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue