From 2285b5ebdf9280e97532e45f55e5fe0d407ce9a5 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Wed, 20 Aug 2025 17:19:57 -0700 Subject: [PATCH] Disable encryption for e2e tests (#1024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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. --- src/main/settings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/settings.ts b/src/main/settings.ts index 81c320d..4153853 100644 --- a/src/main/settings.ts +++ b/src/main/settings.ts @@ -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): 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",