Unverified 提交 2285b5eb authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Disable encryption for e2e tests (#1024)

<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Disable Electron safeStorage encryption in test builds so e2e runs are consistent and don’t require the OS keychain. Added an IS_TEST_BUILD guard in encrypt() to force the unencrypted fallback during tests. <!-- End of auto-generated description by cubic. -->
上级 a66ac3c4
......@@ -6,6 +6,7 @@ import { safeStorage } from "electron";
import { v4 as uuidv4 } from "uuid";
import log from "electron-log";
import { DEFAULT_TEMPLATE_ID } from "@/shared/templates";
import { IS_TEST_BUILD } from "@/ipc/utils/test_utils";
const logger = log.scope("settings");
......@@ -179,7 +180,7 @@ export function writeSettings(settings: Partial<UserSettings>): void {
}
export function encrypt(data: string): Secret {
if (safeStorage.isEncryptionAvailable()) {
if (safeStorage.isEncryptionAvailable() && !IS_TEST_BUILD) {
return {
value: safeStorage.encryptString(data).toString("base64"),
encryptionType: "electron-safe-storage",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论