release(main): 同步 dev 最新候选改动
Storage Persistence Guard / storage-persistence-audit (push) Has been cancelled
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
Client Quality Gates / Shared client and Web (pull_request) Has been cancelled
Client Quality Gates / macOS Desktop (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (push) Has been cancelled
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
Client Quality Gates / Shared client and Web (pull_request) Has been cancelled
Client Quality Gates / macOS Desktop (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (pull_request) Has been cancelled
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const readRestoreView = () => readFileSync(resolve(__dirname, "./DesktopSessionRestore.vue"), "utf8");
|
||||
|
||||
describe("DesktopSessionRestore", () => {
|
||||
it("waits for network recovery without clearing the desktop session", () => {
|
||||
const source = readRestoreView();
|
||||
|
||||
expect(source).toContain("正在恢复登录状态");
|
||||
expect(source).toContain("网络恢复后将自动校验账号并回到工作台");
|
||||
expect(source).toContain("auth.fetchMe({ disableNetworkRetry: true, suppressErrorMessage: true })");
|
||||
expect(source).toContain("window.setInterval");
|
||||
expect(source).toContain('window.addEventListener("online", retryNow)');
|
||||
expect(source).toContain("DESKTOP_SERVER_URL_CHANGED_EVENT");
|
||||
expect(source).toContain("isExplicitAuthCheckFailure(error)");
|
||||
expect(source).toContain("await auth.logout()");
|
||||
expect(source).toContain("retryCount.value += 1");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user