Files
periscope/tests/test_periscope_frontend_theme_rewrite.py
T
michele 5b2d3cd613 iPad top-bar shell, light theme default, Markdown report export (2.85.0).
Replace the left sidebar with a thin top toolbar and tab/sheet navigation.
Light is default; dark mode lives in Settings and persists. Report export
is Save as Markdown (.md) with the findings-tree hierarchy — not Excel.
2026-09-23 07:03:16 +02:00

47 lines
1.6 KiB
Python

"""next-themes wrapper and toggle live under periscope/src."""
from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "periscope" / "src" / "frontend" / "src"
def test_theme_modules_are_src():
for rel in (
"components/theme/theme-provider.tsx",
"components/theme/theme-toggle.tsx",
):
text = (SRC / rel).read_text(encoding="utf-8")
assert "Native Periscope overlay" not in text[:400]
def test_theme_provider_contract():
text = (SRC / "components/theme/theme-provider.tsx").read_text(encoding="utf-8")
assert "export function ThemeProvider" in text
assert 'attribute="class"' in text
assert 'defaultTheme="light"' in text
assert "enableSystem={false}" in text
assert "disableTransitionOnChange" in text
assert 'storageKey="periscope-theme"' in text
clerk = SRC / "components/theme/clerk-theme-provider.tsx"
assert not clerk.exists()
def test_appearance_settings_contract():
text = (SRC / "components/theme/appearance-settings.tsx").read_text(encoding="utf-8")
assert "export function AppearanceSettings" in text
assert "setTheme" in text
assert "Light" in text
assert "Dark" in text
def test_theme_toggle_contract():
text = (SRC / "components/theme/theme-toggle.tsx").read_text(encoding="utf-8")
assert "export function ThemeToggle" in text
assert 'aria-label="Toggle theme"' in text
assert "resolvedTheme" in text
assert 'className="hidden h-4 w-4 dark:block"' in text
assert 'className="h-4 w-4 dark:hidden"' in text