Spaces:
Sleeping
Sleeping
Download dashboard/tests/studio_theme.test.js from JuanCS-Dev/twitch-byte-bot: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/dashboard/tests/studio_theme.test.js
- Command line
-
hf download hf://spaces/JuanCS-Dev/twitch-byte-bot/dashboard/tests/studio_theme.test.js
-
curl -L -o studio_theme.test.js https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/dashboard/tests/studio_theme.test.js
805 Bytes
| import assert from "node:assert/strict"; | |
| import test from "node:test"; | |
| import { THEMES, nextTheme, resolveTheme } from "../features/studio/theme.js"; | |
| test("resolveTheme defaults invalid/empty to auto", () => { | |
| assert.equal(resolveTheme(null), "auto"); | |
| assert.equal(resolveTheme("nonsense"), "auto"); | |
| assert.equal(resolveTheme("dark"), "dark"); | |
| }); | |
| test("nextTheme cycles auto -> light -> dark -> auto", () => { | |
| assert.equal(nextTheme("auto"), "light"); | |
| assert.equal(nextTheme("light"), "dark"); | |
| assert.equal(nextTheme("dark"), "auto"); | |
| }); | |
| test("nextTheme normalizes invalid input first", () => { | |
| assert.equal(nextTheme("garbage"), "light"); // treated as auto -> light | |
| }); | |
| test("THEMES are the three supported modes", () => { | |
| assert.deepEqual(THEMES, ["auto", "light", "dark"]); | |
| }); | |