Skip to content

Commit 8c6775b

Browse files
committed
Loosen Chromatic settings and move them project level
1 parent 88a1969 commit 8c6775b

20 files changed

Lines changed: 28 additions & 57 deletions

File tree

.storybook/preview.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ const preview: Preview = {
4444
),
4545
],
4646
parameters: {
47+
chromatic: {
48+
/**
49+
* Tweaking values, mostly to get rid of false negatives from Datagrid (canvas)
50+
* We can try to tweak this value, also on a component level
51+
*
52+
* https://www.chromatic.com/docs/threshold/
53+
*/
54+
diffThreshold: 0.8,
55+
delay: 500,
56+
},
4757
controls: {
4858
matchers: {
4959
color: /(background|color)$/i,

src/attributes/components/AttributeListDatagrid/AttributeListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { AttributeListDatagrid } from "./AttributeListDatagrid";
77
const meta: Meta<typeof AttributeListDatagrid> = {
88
title: "Attributes/AttributeListDatagrid",
99
component: AttributeListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
attributes,
1513
disabled: false,

src/categories/components/CategoryListDatagrid/CategoryListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { CategoryListDatagrid } from "./CategoryListDatagrid";
77
const meta: Meta<typeof CategoryListDatagrid> = {
88
title: "Categories/CategoryListDatagrid",
99
component: CategoryListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
categories,
1513
disabled: false,

src/categories/components/CategoryProductListDatagrid/CategoryProductListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ const mockProducts: RelayToFlat<NonNullable<CategoryDetailsQuery["category"]>["p
2323
const meta: Meta<typeof CategoryProductListDatagrid> = {
2424
title: "Categories/CategoryProductListDatagrid",
2525
component: CategoryProductListDatagrid,
26-
parameters: {
27-
chromatic: { diffThreshold: 0.3, delay: 500 },
28-
},
26+
2927
args: {
3028
products: mockProducts,
3129
disabled: false,

src/collections/components/CollectionListDatagrid/CollectionListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { CollectionListDatagrid } from "./CollectionListDatagrid";
77
const meta: Meta<typeof CollectionListDatagrid> = {
88
title: "Collections/CollectionListDatagrid",
99
component: CollectionListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
collections,
1513
loading: false,

src/components/Datagrid/Datagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ const meta: Meta<typeof Datagrid> = {
152152
onColumnResize: { table: { disable: true } },
153153
onRowSelectionChange: { table: { disable: true } },
154154
},
155-
parameters: {
156-
chromatic: { diffThreshold: 0.3, delay: 500 },
157-
},
155+
158156
args: {
159157
availableColumns: columns,
160158
rows: initialData.length,

src/customers/components/CustomerListDatagrid/CustomerListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { CustomerListDatagrid } from "./CustomerListDatagrid";
77
const meta: Meta<typeof CustomerListDatagrid> = {
88
title: "Customers/CustomerListDatagrid",
99
component: CustomerListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
customers: customerList,
1513
loading: false,

src/discounts/components/DiscountListDatagrid/DiscountListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { DiscountListDatagrid } from "./DiscountListDatagrid";
77
const meta: Meta<typeof DiscountListDatagrid> = {
88
title: "Discounts/DiscountListDatagrid",
99
component: DiscountListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
promotions: discountList,
1513
disabled: false,

src/discounts/components/VoucherCodesDatagrid/VoucherCodesDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ const mockCodes: VoucherCode[] = [
1414
const meta: Meta<typeof VoucherCodesDatagrid> = {
1515
title: "Discounts/VoucherCodesDatagrid",
1616
component: VoucherCodesDatagrid,
17-
parameters: {
18-
chromatic: { diffThreshold: 0.3, delay: 500 },
19-
},
17+
2018
args: {
2119
codes: mockCodes,
2220
loading: false,

src/discounts/components/VoucherListDatagrid/VoucherListDatagrid.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { VoucherListDatagrid } from "./VoucherListDatagrid";
77
const meta: Meta<typeof VoucherListDatagrid> = {
88
title: "Discounts/VoucherListDatagrid",
99
component: VoucherListDatagrid,
10-
parameters: {
11-
chromatic: { diffThreshold: 0.3, delay: 500 },
12-
},
10+
1311
args: {
1412
vouchers: voucherList,
1513
disabled: false,

0 commit comments

Comments
 (0)