Skip to content

Commit

Permalink
Add diffThreshold to storybook (#8778)
Browse files Browse the repository at this point in the history
This is still a test but I think needs to be merged into main before we
can compare against it. I will follow up with a test PR to test this.
This new threshold will catch smaller changes like 4px border-radius
changes that weren't caught in [this
pr](#8626)

I compared the two snapshots using the chromatic tool
[here](https://6262c53f521620003ac2ff49-ukmsdlppcb.chromatic.com/?path=/story/stories-diff-threshold-check--test-yours-out)


https://user-images.githubusercontent.com/6844391/228541322-b5fddce0-10cb-4b41-bfda-8873ee6651b0.mp4
  • Loading branch information
kyledurand committed Mar 29, 2023
1 parent 444d7b2 commit a4f3838
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-comics-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Increased precision of chromatic snapshot diffs
6 changes: 5 additions & 1 deletion polaris-react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ const viewPorts = Object.entries({
};
});

export const parameters = {viewport: {viewports: {...viewPorts}}};
export const parameters = {
viewport: {viewports: {...viewPorts}},
// Increases precision of rendered snapshot diffs. Default is 0.063
chromatic: {diffThreshold: 0.03},
};

export const decorators = [
GridOverlayDecorator,
Expand Down

0 comments on commit a4f3838

Please sign in to comment.