mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-28 21:45:51 +08:00
16 lines
616 B
TypeScript
16 lines
616 B
TypeScript
import { expect, test } from "bun:test"
|
|
import { migrateV1, resolveThemeDocument } from "../src/tui/index.js"
|
|
import type { ThemeV1Json } from "../src/tui/v1.js"
|
|
|
|
const source: ThemeV1Json = await Bun.file(
|
|
new URL("../../tui/src/theme/assets/opencode.json", import.meta.url),
|
|
).json()
|
|
const document = migrateV1(source)
|
|
|
|
test.each(["light", "dark"] as const)("resolves %s themes without status tokens", (mode) => {
|
|
const theme = resolveThemeDocument(document, mode)
|
|
expect("status" in theme.text).toBeFalse()
|
|
expect(theme.hue.accent[800]).toBeDefined()
|
|
expect(theme.hue.interactive[800]).toBeDefined()
|
|
})
|