Skip to content
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

Refactor VisualTests to allow selecting viewport + browser. #18

Merged

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Jul 24, 2023

Add stories for sub components and refactor how data is passed into them.

  • Now the SnapshotComparison takes a list of tests that correspond to a single story
    • It uses a helper useTests to maintain which is the selected test/comparison
  • Lifted state out of Viewport+BrowserSelector into SnapshotComparison
  • BuildInfo component now takes a proper build document rather than a smattering of fields.
  • VisualTests component is simpler as a result of the above.
  • I also refactored the test/story construction a little bit.
📦 Published PR as canary version: 0.0.7--canary.18.09f95cd.0

✨ Test out this PR locally via:

npm install @chromaui/addon-visual-tests@0.0.7--canary.18.09f95cd.0
# or 
yarn add @chromaui/addon-visual-tests@0.0.7--canary.18.09f95cd.0

@linear
Copy link

linear bot commented Jul 24, 2023

src/utils/storyData.ts Outdated Show resolved Hide resolved
src/utils/useTests.ts Outdated Show resolved Hide resolved
src/utils/useTests.ts Outdated Show resolved Hide resolved
@tmeasday tmeasday merged commit 160a77f into main Jul 25, 2023
6 checks passed
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.

None yet

2 participants