Skip to content

test(phase-0): add foundation_tokens browser test module#184

Merged
intendednull merged 1 commit into
mainfrom
test/foundation-tokens
Apr 21, 2026
Merged

test(phase-0): add foundation_tokens browser test module#184
intendednull merged 1 commit into
mainfrom
test/foundation-tokens

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Summary

Closes the Task 14 test-coverage gap from the Phase 0 foundation-shell plan (docs/plans/2026-04-19-ui-phase-0-foundation.md). Adds a mod foundation_tokens in crates/web/tests/browser.rs with three tests:

  • foundation_palette_tokens_defined — iterates 25 palette / ink / moss / amber / state / radius / shadow / focus / font / motion tokens on :root and asserts every computed value is non-empty.
  • legacy_bg_main_aliases_bg_0 — asserts --bg-main (style.css) resolves to the same computed value as --bg-0 (foundation.css), proving the Phase 0 alias layer is live.
  • data_accent_swap_changes_moss_2 — swaps data-accent between moss and willow on <html> and asserts --moss-2 updates then reverts.

Followed the existing ensure_style_css_loaded harness pattern (browser.rs:6979); added module-local ensure_foundation_css_loaded + ensure_style_css_loaded helpers that inject CSS via include_str! with dedupe-id guards (wasm-pack does not bundle stylesheets).

Test plan

  • cargo fmt --all --check — clean.
  • just clippy — zero warnings.
  • just test-browser — new tests pass under headless Firefox (not run locally — CI gate).

Out of scope

  • Pre-existing clippy::self_assignment on browser.rs:9193 (ancestor commit 57f79309) is untouched; just clippy does not lint --tests so the workspace gate is green.

Companion PR: docs/phase-0-plan-ticks (plan doc-hygiene).

🤖 Generated with Claude Code

Closes the Task 14 test-coverage gap from the Phase 0 foundation-shell
plan (docs/plans/2026-04-19-ui-phase-0-foundation.md). Three tests:

- foundation_palette_tokens_defined — asserts every palette/ink/state
  token on :root resolves to a non-empty computed value.
- legacy_bg_main_aliases_bg_0 — asserts --bg-main (style.css) inherits
  the same value as --bg-0 (foundation.css), proving the reskin alias
  layer is live.
- data_accent_swap_changes_moss_2 — toggles data-accent on #app-root
  and asserts the accent-controlled token updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intendednull intendednull merged commit a68e7ee into main Apr 21, 2026
4 checks passed
@intendednull intendednull deleted the test/foundation-tokens branch April 21, 2026 21:10
intendednull added a commit that referenced this pull request Apr 21, 2026
Resolves conflict at EOF of crates/web/tests/browser.rs — both sides
appended independent test modules (phase_2c_profile_card here, then
foundation_tokens from PR #184). Keep both.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
intendednull added a commit that referenced this pull request Apr 21, 2026
Resolves conflict at EOF of crates/web/tests/browser.rs — both sides
appended independent test content (phase 2e top-level tests here, then
`mod foundation_tokens` from PR #184). Keep both.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
intendednull added a commit that referenced this pull request Apr 21, 2026
Takes HEAD's browser.rs (phase-2b sync-queue tests, 10335 lines) and
appends the foundation_tokens module from origin/main (PR #184, Task 14)
at EOF. Both test modules live independently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant