Skip to content

Commit

Permalink
Merge pull request #620 from open-formulieren/feature/584-add-viewpor…
Browse files Browse the repository at this point in the history
…t-modes-chromatic

Add mobile/desktop tests in chromatic
  • Loading branch information
sergei-maertens authored Dec 27, 2023
2 parents afa4839 + 245f428 commit d82221e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ export default {
},
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
viewport: {
// These are the viewports that are shown in Storybook
viewports: {
smallMobile: { name: "Small mobile", styles: { width: "320px", height: "568px" } },
largeMobile: { name: "Large mobile", styles: { width: "414px", height: "896px" } },
tablet: { name: "Tablet", styles: { width: "834px", height: "1112px" } },
desktop: { name: "Desktop", styles: { width: "1024px", height: "1000px" } },
},
},
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down Expand Up @@ -85,6 +94,13 @@ export default {
],
},
},
chromatic: {
// Here we specify the viewports of which we want snapshots in Chromatic
modes: {
mobile: {viewport: "smallMobile"},
desktop: {viewport: "desktop"}
}
}
},
loaders: [mswLoader],
};

0 comments on commit d82221e

Please sign in to comment.