import { readFileSync } from "node:fs"; import { describe, expect, it } from "vitest"; import { defaultConfig, mergeConfig } from "../extensions/zentui/config"; const snapshot = JSON.parse( readFileSync(new URL("./fixtures/selesai-defaults.json", import.meta.url), "utf8"), ); describe("Selesai Zentui defaults", () => { it("matches the adopted user settings without requiring a user config", () => { expect(defaultConfig.components).toMatchObject(snapshot.components); expect(mergeConfig({}, {}).components).toMatchObject(snapshot.components); }); it("still allows user overrides", () => { const config = mergeConfig({ components: { editor: { enabled: false, style: "opencode" }, workingLine: { spinner: "braille", segments: { tokenRate: false } }, footer: { style: "native" }, } }, {}); expect(config.components.editor.enabled).toBe(false); expect(config.components.editor.style).toBe("opencode"); expect(config.components.workingLine.spinner).toBe("braille"); expect(config.components.workingLine.segments.tokenRate).toBe(false); expect(config.components.footer.style).toBe("native"); }); });