import { describe, expect, it } from "vitest"; import { buildDefaultConnectorRows, parseEnvBindingText } from "../../src/main/connectors"; describe("parseEnvBindingText", () => { it("ignores comments and blank lines while preserving values with equals", () => { expect( parseEnvBindingText(` # comment OPENAI_API_KEY=vault-openai CUSTOM=value=with=equals `), ).toEqual({ OPENAI_API_KEY: "vault-openai", CUSTOM: "value=with=equals", }); }); }); describe("buildDefaultConnectorRows", () => { it("preserves previously saved connector overrides", () => { const rows = buildDefaultConnectorRows([ { id: "openai-codex", status: "ready", notes: "custom note", }, ]); const codex = rows.find((row) => row.id === "openai-codex"); if (!codex) { throw new Error("openai-codex connector not found in default rows."); } expect(codex.id).toBe("openai-codex"); expect(codex.status).toBe("ready"); expect(codex.notes).toBe("custom note"); expect(codex.capabilityMatrix.structuredTranscript).toBe(true); }); });