Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

1.1 KB
Raw Blame
import { afterEach, describe, expect, it } from "vite-plus/test";

import { OCEAN_THEME_ID, T3_CHAT_THEME_ID } from "../../themePalette";
import { toggleThemeEditorForTheme, useThemeEditorStore } from "./themeEditorStore";

afterEach(() => {
  useThemeEditorStore.getState().closeThemeEditor();
});

describe("toggleThemeEditorForTheme", () => {
  it("opens a new editor seeded from the theme active for the current appearance", () => {
    toggleThemeEditorForTheme({
      theme: T3_CHAT_THEME_ID,
      themeHalves: { dark: OCEAN_THEME_ID },
      initialAppearance: "dark",
    });

    expect(useThemeEditorStore.getState().session).toMatchObject({
      editingThemeId: null,
      seedThemeId: OCEAN_THEME_ID,
      seedName: null,
      initialAppearance: "dark",
    });
  });

  it("closes an open editor", () => {
    toggleThemeEditorForTheme({
      theme: T3_CHAT_THEME_ID,
      themeHalves: null,
      initialAppearance: "light",
    });
    toggleThemeEditorForTheme({
      theme: T3_CHAT_THEME_ID,
      themeHalves: null,
      initialAppearance: "light",
    });

    expect(useThemeEditorStore.getState().session).toBeNull();
  });
});