File tree Expand file tree Collapse file tree
packages/react/.storybook Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,43 @@ test step-by-step to debug what's going on. It will also allow you to interact
9797with the page to quickly find selectors you can use to find items to run tests
9898against.
9999
100+ #### Chromatic Visual Regression Testing
101+
102+ Chromatic is used for visual regression testing of Storybook stories. By
103+ default, stories are tested in the following modes:
104+
105+ - ` g10 ` theme
106+ - ` g100 ` theme
107+ - ` breakpoint-sm ` viewport
108+
109+ The ` g90 ` theme is intentionally excluded from global Chromatic coverage to
110+ reduce snapshot volume. However, individual stories can opt into g90 coverage
111+ when needed.
112+
113+ ##### Opting a Story into g90 Coverage
114+
115+ To include g90 theme snapshots for a specific story, import ` allModes ` from the
116+ Storybook modes configuration and add it to the story's parameters:
117+
118+ ``` js
119+ import { allModes } from ' ../../.storybook/modes' ;
120+
121+ export const MyStory = {
122+ parameters: {
123+ chromatic: {
124+ modes: {
125+ g10: allModes[' g10' ],
126+ g90: allModes[' g90' ], // Opt into g90 coverage
127+ g100: allModes[' g100' ],
128+ },
129+ },
130+ },
131+ };
132+ ```
133+
134+ This approach allows targeted g90 coverage for stories where it's specifically
135+ needed, such as when addressing theme-specific bugs or visual regressions.
136+
100137## FAQ
101138
102139### Why am I seeing ` browserType.launch: Executable doesn't exist at ../path ` ?
Original file line number Diff line number Diff line change @@ -328,9 +328,11 @@ const parameters = {
328328 } ,
329329 } ,
330330 chromatic : {
331+ // g90 is intentionally excluded from global Chromatic coverage to reduce
332+ // snapshot volume. Individual stories can opt into g90 coverage by setting
333+ // parameters.chromatic.modes to include allModes.g90
331334 modes : {
332335 g10 : allModes [ 'g10' ] ,
333- g90 : allModes [ 'g90' ] ,
334336 g100 : allModes [ 'g100' ] ,
335337 'breakpoint-sm' : allModes [ 'breakpoint-sm' ] ,
336338 } ,
You can’t perform that action at this time.
0 commit comments