-
Notifications
You must be signed in to change notification settings - Fork 80
test: add token snapshot tests #8050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
provides design tokens as a javascript object
Use-case: Design Token user want to treeshake tokens
This is not super useful but it’s better than “any”
any changes to token output should be caught and manually approved
…/token-snapshot-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice. I might be missing something, but I do have some questions:
- What is the expected code change/PR review/test workflow? It's comparing against all output targets, so does this mean any change to tokens could potentially cause a test failure?
- If ☝️ is yes, what is the difference between a. reviewing a change to the design tokens package source and b. accepting the diff from the updated snapshot? There might be a bit of redundancy between a and b.
- What is the main objective of these tests? If it's to make sure the generated files are not impacted in a major way, would the components package testing help catch this type of change? If it's to make sure all changes get double checked, how can we make sure it won't get noisy and reviews will be effective?
- Is there an alternative that wouldn't require us to keep a copy of all output targets as the base for snapshot tests? This would only grow as we add more tokens and output targets, right?
Yes any change to platform outputs will cause a test failure.
Because changes may be made to the token transformer which would cause a change in the output even if the tokens themselves remain the same. This also helps future proof tokens so changes aren't accidentally made in Figma and pushed up. It's a lot easier to miss mistakes on the design side.
The main objective is to catch changes made to the platform output of tokens.
Along with being the only way to fully test tokens prior to building calcite-components as well, keeping a static record of how we expect tokens to look is valuable because it allows us to review token output from Github without pulling the branch down and building locally. |
Thanks for the additional context. Agreed that this would be super useful for token test coverage. 🎉 I am curious to see what the update workflow ends up looking like since the snapshot test base is volatile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
* origin/main: (30 commits) test: add token snapshot tests (#8050) chore: release next fix(color-picker, popover, shell-panel, slider, tooltip): Register events on the window instead of the document (#8247) fix(list-item): Reserve space for empty open lists. (#8239) fix: dragging floating ui components (#8230) fix(list-item): an item with an empty slotted list should be openable. (#8240) fix(input): prevents mutating value on `blur` when `type="number"` (#8245) chore: release main (#8092) chore: downgrade eslint plugin after reverting breaking change (#8238) refactor(combobox): fix linting errors (#8235) chore: downgrade packages after reverting 2.0.0-next.0 change (#8237) chore: release next revert: feat(stepper-item)!: remove support for previousStep and nextStep in messages (#8222) (#8232) feat(stepper): enable responsive layout (#7744) feat(combobox): limit display of selected items with new selection-display prop (#7912) chore: release next build: update browserslist db (#8218) fix(list-item): fix rendering of open icon. (#8207) revert: feat(alert): make component responsive (#8195) fix(input-number): prevents mutating value on blur (#8226) ...
* origin/main: (30 commits) test: add token snapshot tests (#8050) chore: release next fix(color-picker, popover, shell-panel, slider, tooltip): Register events on the window instead of the document (#8247) fix(list-item): Reserve space for empty open lists. (#8239) fix: dragging floating ui components (#8230) fix(list-item): an item with an empty slotted list should be openable. (#8240) fix(input): prevents mutating value on `blur` when `type="number"` (#8245) chore: release main (#8092) chore: downgrade eslint plugin after reverting breaking change (#8238) refactor(combobox): fix linting errors (#8235) chore: downgrade packages after reverting 2.0.0-next.0 change (#8237) chore: release next revert: feat(stepper-item)!: remove support for previousStep and nextStep in messages (#8222) (#8232) feat(stepper): enable responsive layout (#7744) feat(combobox): limit display of selected items with new selection-display prop (#7912) chore: release next build: update browserslist db (#8218) fix(list-item): fix rendering of open icon. (#8207) revert: feat(alert): make component responsive (#8195) fix(input-number): prevents mutating value on blur (#8226) ...
**Related Issue:** n/a ## Summary Adds a debugger script for calcite-design-tokens in VSCode (launch.json) Adds snapshot tests to enforce token output
**Related Issue:** n/a ## Summary Adds a debugger script for calcite-design-tokens in VSCode (launch.json) Adds snapshot tests to enforce token output
**Related Issue:** n/a ## Summary Adds a debugger script for calcite-design-tokens in VSCode (launch.json) Adds snapshot tests to enforce token output
Related Issue: n/a
Summary
Adds a debugger script for calcite-design-tokens in VSCode (launch.json)
Adds snapshot tests to enforce token output