test(theme): cover applyDarkMode's SSR guard

↗ view on GitHub · duncanmcqueen · 2026-08-22 · 538c5338

theme.ts is inside the coverage-gated src/app/lib/** include set, but
its two existing tests both run under jsdom, where `document` is always
defined. The `typeof document === "undefined"` early return was never
taken, leaving theme.ts at 75% branches and pulling the lib layer's
global branch coverage to 96.91% - just under the 97% ratchet floor.

Stub `document` away for a third case so both arms of the guard are
exercised. theme.ts is now 100% across all four metrics and the global
branch figure is back to 97.15%.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Repository open-legal-products/mike
Author duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
Authored
Parents 00f6ad75
Stats 1 file changed , +7 , -1
Part of Add per-user dark mode

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-538c5338.md from inside the repo you want the change in.

⬇ Download capture-commit-538c5338.md