Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/review/app/src/animation/animation-block.browser.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";

import { schemeOf } from "./animation-block";

describe("schemeOf", () => {
it("takes the host's own light or dark palette", () => {
expect(schemeOf("dark")).toBe("dark");
expect(schemeOf("light")).toBe("light");
expect(schemeOf("normal")).toBe("light");
});

it("follows the reader's preference where the host names both", () => {
const dark = matchMedia("(prefers-color-scheme: dark)").matches;

expect(schemeOf("light dark")).toBe(dark ? "dark" : "light");
expect(schemeOf("dark light")).toBe(dark ? "dark" : "light");
});
});
Loading
Loading