Files
local-cal/tests/legacy-design-migration.test.ts
Dmytro Stanchiev 276fbad45e chore: legacy cleanup
Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
2026-04-21 20:24:04 -04:00

69 lines
2.7 KiB
TypeScript

import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
const read = (path: string) => readFileSync(path, "utf8");
describe("legacy design migration", () => {
test("global styles remove obsolete glass helpers once console surfaces take over", () => {
const source = read("src/app/globals.css");
expect(source).not.toContain(".glass-surface");
expect(source).not.toContain(".glass-panel");
expect(source).not.toContain(".glass-subtle");
expect(source).not.toContain(".glass-card");
expect(source).not.toContain(".glass-strong");
});
test("layout metadata and toast surface use redesign language", () => {
const layout = read("src/app/layout.tsx");
const manifest = read("src/app/manifest.ts");
expect(layout).not.toContain("Local iCal");
expect(layout).not.toContain("editor for calendar events");
expect(layout).not.toContain("glass-strong");
expect(manifest).not.toContain("local-ical");
expect(manifest).not.toContain("Local iCal editor");
});
test("auth screens use console surfaces instead of old glass cards", () => {
const signIn = read("src/app/auth/signin/sign-in-form.tsx");
const signOut = read("src/app/auth/signout/page.tsx");
const errorPage = read("src/app/auth/error/page.tsx");
expect(signIn).not.toContain("glass-strong");
expect(signOut).not.toContain("glass-strong");
expect(errorPage).not.toContain("glass-strong");
expect(signIn).not.toContain("rounded-2xl");
expect(signOut).not.toContain("rounded-2xl");
expect(errorPage).not.toContain("rounded-2xl");
});
test("auth and app copy use timeline-first language", () => {
const signIn = read("src/app/auth/signin/sign-in-form.tsx");
const errorPage = read("src/app/auth/error/page.tsx");
const settings = read("src/components/settings-panel.tsx");
expect(signIn).not.toContain("Local iCal");
expect(signIn).not.toContain("event creation");
expect(errorPage).not.toContain("Homepage");
expect(settings).not.toContain("review modal");
});
test("overlay surfaces use console framing instead of blur-heavy legacy treatments", () => {
const autocomplete = read("src/components/location-autocomplete.tsx");
const dragDrop = read("src/components/drag-drop-container.tsx");
expect(autocomplete).not.toContain("backdrop-blur-sm");
expect(autocomplete).toContain("rounded-[10px]");
expect(dragDrop).not.toContain("rounded-xl");
expect(dragDrop).not.toContain("backdrop-blur-sm");
expect(dragDrop).toContain("rounded-[10px]");
});
test("settings internal rows drop the old bordered mini-card treatment", () => {
const settings = read("src/components/settings-panel.tsx");
expect(settings).not.toContain("rounded-xl border border-border/60 bg-muted/35");
});
});