chromaui / addon-visual-tests

Visual Tests addon for Storybook
MIT License
30 stars 1 forks source link

Reset Diff Toggles for New Stories #187

Closed thafryer closed 4 months ago

thafryer commented 5 months ago

Previously, if you changed to a story where the comparison is new and the Baseline toggle shows the baseline snapshot, there would be no image shown in the comparison viewer. This PR adjusts the behavior so that for new stories, the user always sees the latest snapshot.

To QA:

  1. Install this canary.
  2. Add a new Story to an Existing Storybook and change an existing story within the Storybook.
  3. Go to the existing story and toggle the snapshot so that you see the Baseline image.
  4. Go to the New Story and verify that you see "Latest Snapshot" along with the image.

    📦 Published PR as canary version: 1.1.10--canary.187.a1de870.0
    :sparkles: Test out this PR locally via: ```bash npm install @chromatic-com/storybook@1.1.10--canary.187.a1de870.0 # or yarn add @chromatic-com/storybook@1.1.10--canary.187.a1de870.0 ```