import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";

const mainCss = readFileSync(resolve(process.cwd(), "src/main.css"), "utf8");

describe("clients main.css", () => {
  it("keeps shared package sources and theme tokens aligned with the main app", () => {
    expect(mainCss).toContain('@source "../../../packages/chat-ui/src/**/*.{ts,tsx}";');
    expect(mainCss).toContain('@source "../../../packages/tablo-views/src/**/*.{ts,tsx}";');
    expect(mainCss).toContain('@source "../../../packages/auth-ui/src/**/*.{ts,tsx}";');
    expect(mainCss).toContain("--navbar-background: rgb(249, 250, 251);");
    expect(mainCss).toContain("--color-navbar-background: var(--navbar-background);");
    expect(mainCss).toContain("--str-chat__own-message-bubble-color: #804eec;");
    expect(mainCss).toContain("--str-chat__own-message-text-color: #ffffff;");
  });
});
