完善桌面端界面、发布检查与邮箱域名同步
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled

This commit is contained in:
Cheng Zhou
2026-07-01 10:49:31 +08:00
parent c923f887a0
commit 9cac75e85c
32 changed files with 5392 additions and 2684 deletions
+22 -1
View File
@@ -1,10 +1,11 @@
import { afterEach, describe, expect, it } from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";
import packageInfo from "../../package.json";
import { clientRuntime } from "./clientRuntime";
import { getAppMetadata } from "./appMetadata";
afterEach(() => {
Reflect.deleteProperty(window, "__TAURI_INTERNALS__");
vi.unstubAllEnvs();
});
describe("client runtime", () => {
@@ -32,4 +33,24 @@ describe("client runtime", () => {
expect(clientRuntime.capabilities().serverConfiguration).toBe(true);
expect(clientRuntime.capabilities().secureSessionStorage).toBe(false);
});
it("accepts release build metadata only from the expected CI values", () => {
vi.stubEnv("VITE_BUILD_CHANNEL", "release");
vi.stubEnv("VITE_BUILD_COMMIT", "0123456789abcdef0123456789abcdef01234567");
expect(getAppMetadata()).toMatchObject({
channel: "release",
commit: "0123456789abcdef0123456789abcdef01234567",
});
});
it("does not expose arbitrary build metadata strings", () => {
vi.stubEnv("VITE_BUILD_CHANNEL", "feature/demo");
vi.stubEnv("VITE_BUILD_COMMIT", "token=secret");
expect(getAppMetadata()).toMatchObject({
channel: "local",
commit: "local",
});
});
});