test(coverage): Phase 6 — regression tests & full demo coverage - #41
Conversation
- Demo: full states coverage — all 25+ .is-* classes exercised (F-14) - Demo: missing layout primitives — sf-imposter, sf-subgrid, sf-section-group, sf-cover modifiers, sf-cluster--no-wrap, sf-switcher modifiers, sf-grid-1, ratio grids (1-2, 2-1, 1-3, 3-1), sf-scale-down, and all remaining modifier variants referenced for selector inventory completeness - New test: tests/layers.spec.js — verifies cascade layer ordering invariant (themes > components, states > utilities, motion > themes) - New test: tests/print.spec.js — verifies <mark> retains background in print, .no-print hides, .print-color-exact forces exact - New test: tests/coverage.spec.js — parses all .sf-* and .is-* from core/*.css, asserts each appears in docs/demo.html. Eliminates F-14-type regressions permanently. Resolves: F-14 (demo coverage gaps)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds two demo sections to ChangesDesign System Coverage and Validation
Possibly Related PRs
Suggested Reviewers
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/layers.spec.js`:
- Line 13: The test uses a fragile file:// link in setContent which can break
across environments; replace that pattern by loading the built CSS via the
Playwright API: in tests/layers.spec.js locate the test(s) that inject the HTML
with <link rel="stylesheet"
href="file://${process.cwd()}/dist/slashed.essential.css"> and instead call
page.addStyleTag({ path: path.join(process.cwd(), 'dist',
'slashed.essential.css') }) (or addStyleTag({ content: ... }) if you prefer
reading the file contents) before asserting layer order; ensure you remove the
inline link from setContent and perform addStyleTag in the same test setup (same
page instance) so the stylesheet is reliably applied in CI/Windows.
In `@tests/print.spec.js`:
- Around line 28-45: The test "test('.no-print elements are hidden in print')"
is flakily asserting styles because the stylesheet may not be loaded when
hiddenDisplay/visibleDisplay are read; update the test to ensure the CSS is
applied before evaluating styles (e.g., instead of relying on the file:// <link>
in page.setContent, load the stylesheet deterministically using page.addStyleTag
or wait for the stylesheet link to finish loading after page.setContent), then
only call page.locator(...).evaluate(...) for hiddenDisplay and visibleDisplay;
keep the existing assertions but ensure the test awaits stylesheet application
using page.emulateMedia and either a wait-for-link or addStyleTag approach to
guarantee print rules (including .no-print and print-color-exact) are active.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7a37f153-978e-4b86-8f65-6e705bfd78d4
📒 Files selected for processing (4)
docs/demo.htmltests/coverage.spec.jstests/layers.spec.jstests/print.spec.js
…obustness - Fix --sf-transition-colors: expand each property with its own duration/easing (was malformed — only stroke got the timing) - Add overflow:hidden fallback before overflow:clip in .sr-only for Safari <16 compatibility - Replace fragile file:// protocol in tests with page.addStyleTag() for reliable CSS loading in CI environments
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Summary
Phase 6 — Coverage & regression tests. Completes the full audit remediation plan.
Changes
.is-*classes exercised with live examples (resolves F-14).sf-imposter(+--contain,--fixed),.sf-subgrid/.sf-subgrid-rows,.sf-section-group,.sf-covermodifiers (--min,--max,--padding-s,--padding-l),.sf-cluster--no-wrap,.sf-switcher--no-wrap/--vertical,.sf-grid-1, ratio grids (1-2,2-1,1-3,3-1),.sf-scale-down, and all modifier variant referencestests/layers.spec.js— verifies cascade layer ordering invariant (themes > components, states > utilities, motion > themes)tests/print.spec.js— verifies<mark>retains background in print emulation,.no-printhides,.print-color-exactforcesprint-color-adjust: exacttests/coverage.spec.js— parses all.sf-*and.is-*selectors fromcore/*.css, asserts each appears at least once indocs/demo.html. Permanently prevents F-14-type regressions.Testing
npx playwright testwith browser installNotes
Summary by CodeRabbit
Documentation
Tests
Bug Fixes