中文:收口权限与中心/立项配置改造

This commit is contained in:
Cheng Zhou
2026-05-12 10:16:52 +08:00
parent 6e90370a5f
commit 77e842637d
67 changed files with 706 additions and 669 deletions
+18 -1
View File
@@ -25,7 +25,7 @@ describe("Login protocol agreement", () => {
expect(source).toContain("记住密码");
expect(source).toContain('autocomplete="username"');
expect(source).toContain('name="username"');
expect(source).toContain('name="password"');
expect(source).toContain(":name=\"form.rememberPassword ? 'password' : 'ctms-login-password'\"");
expect(source).toContain("tryLoadBrowserCredential");
expect(source).toContain("tryStoreBrowserCredential");
expect(source).toContain("navigator.credentials");
@@ -45,4 +45,21 @@ describe("Login protocol agreement", () => {
expect(source).toContain("权限与审计");
expect(source).toContain("confirmProtocol");
});
it("persists the protocol agreement checkbox in localStorage", () => {
const source = readLoginView();
expect(source).toContain("const AGREE_PROTOCOL_KEY = \"ctms_agree_protocol\"");
expect(source).toContain('localStorage.getItem(AGREE_PROTOCOL_KEY) === "true"');
expect(source).toContain('localStorage.setItem(AGREE_PROTOCOL_KEY, String(checked))');
expect(source).toContain("confirmProtocol");
});
it("avoids browser password caching when remember password is off", () => {
const source = readLoginView();
expect(source).toContain(":name=\"form.rememberPassword ? 'password' : 'ctms-login-password'\"");
expect(source).toContain(":autocomplete=\"form.rememberPassword ? 'current-password' : 'new-password'\"");
expect(source).not.toContain('autocomplete="current-password"');
});
});