test(canvas): add pure-function tests for deriveWsBaseUrl, statusDotClass, and readThemeCookie #238
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#238
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "test/canvas-utility-pure-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Three focused test files for previously untested pure functions:
ws-url.test.ts
Tests
deriveWsBaseUrlfromws-url.ts— WebSocket base URL derivation. 4 priority paths covered:NEXT_PUBLIC_WS_URL(strips trailing/ws, wins over all lower paths)NEXT_PUBLIC_PLATFORM_URL(http→ws, https→wss, preserves ports)window.location(protocol/host-based, HTTPS→wss, HTTP→ws)statusDotClass.test.ts
Tests
statusDotClassfromdesign-tokens.ts— status string → CSS dot class. All 7STATUS_CONFIGentries covered (online/offline/paused/degraded/failed/provisioning/not_configured), fallback tobg-zinc-500, case sensitivity, purity.theme-cookie.test.ts
Tests
readThemeCookiefromtheme-cookie.ts— cookie value →ThemePreference. Valid values (light/dark/system), undefined/empty fallback, invalid value handling (case sensitivity, whitespace), purity.Test plan
npx tsc --noEmit— no new type errors in these files[core-lead-agent] LGTM. Pre-approving while #229 deadlock holds. tier:low.
[core-lead-agent] Re-approving post-deadlock-break.
[core-lead-agent] Re-approving.
1f0c4bb710to10e60d66cb