Repository navigation
AUI: Add parity tests for reference tokens and CLI style generation - #316
Merged
Merged
Conversation
Snapshot the evaluated reference tokens: - Color: base, layer, palette and recipe tokens for several base colors, light and dark layers, and layer nesting. - Density: padding and gap tokens for several density adjustments, design units and stroke thicknesses. Regenerate with UPDATE_SNAPSHOTS=1 when a change is intentional. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
path.format ignores ext when base is present, so the prettier filepath stayed index.js for non-JSON anatomies and parsing the CSS failed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Compile test only fixtures with the aui CLI and compare the generated stylesheets and reported warnings to a checked in baseline, so diffs of the generated css show regressions in style generation. The fixtures are samples adapted from Adaptive Web Components and Polar UI anatomies, plus made up anatomies stressing each capability of the style generation. The capabilities are also asserted directly by the unit tests. npm run styles:oracle compiles and diffs, styles:oracle:update replaces the baseline. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 30aaab3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds parity tests for the reference tokens and for style generation by the
auiCLI, so refactors can be checked for regressions, and fixes a bug inaui compile-stylesfound while doing so.src/reference/parity.spec.ts): snapshots the evaluated color (base, layer, palette, and recipe) tokens for several base colors, light and dark layers, and layer nesting, and the density tokens for several density adjustments, design units, and stroke thicknesses. Tokens are resolved through a real element hierarchy (a stub stands in forFASTElementas jsdom has no custom elements), so inheritance and derived values behave as in the browser. Regenerate withnpm run unit-tests:update-snapshots.aui compile-stylesfor code anatomies:path.formatignoresextwhenbaseis present, so prettier parsed the CSS asindex.jsand every component with a TypeScript/JavaScript anatomy failed to compile (only JSON anatomies worked). Includes a changeset.scripts/styles-oracle.mjs,src/__test__/styles-oracle): compiles test only fixtures with the real CLI (compile-styles,compile-style,compile-json-anatomy, and the-eoption) and compares the generated stylesheets and reported warnings to a checked in baseline. The fixtures are samples adapted from Adaptive Web Components and Polar UI anatomies, plus made up anatomies that stress each capability of the style generation. About 55 capabilities are also asserted directly, so the baseline is not taken on trust.npm run styles:oraclediffs andnpm run styles:oracle:updatereplaces the baseline.Issues
Reviewer Notes
src/andscripts/are in.npmignore). The copies are not kept in sync with their sources.::get no state selector (hover, active, and focus collapse to one selector), AWC'sanchorgenerates the never matching:host(:not([href])[href]), and the header comment of code anatomies always saysfrom index.js.npm run build && npm run unit-testsinpackages/adaptive-ui, thennpm run styles:oracle.🤖 Generated with Claude Code