Skip to content

Commit 200420d

Browse files
chore(chromatic): disable flaky snapshots (#3829)
1 parent 2f69783 commit 200420d

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/elements/content-preview/stories/ContentPreview.stories.js

+5
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ export default {
7070
hasHeader: true,
7171
token: global.TOKEN,
7272
},
73+
parameters: {
74+
chromatic: {
75+
disableSnapshot: true,
76+
},
77+
},
7378
};

src/elements/content-preview/stories/tests/ContentPreview-visual.stories.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ export const hoverOverCitation = {
119119
const citation = await modal.getByRole('button', { name: 'Reference 1' });
120120
expect(citation).toBeInTheDocument();
121121
await userEvent.hover(citation);
122+
123+
const main = await waitFor(() => document.querySelector('.sb-main-padded.sb-show-main'));
124+
await waitFor(async () => {
125+
await expect(within(main).getByText('Public APIs are key drivers of innovation and growth.')).toBeVisible();
126+
});
122127
},
123128
};
124129

@@ -249,7 +254,7 @@ export default {
249254
},
250255
parameters: {
251256
chromatic: {
252-
ignoreSelectors: ['[data-testid="content-answers-question-input-avatar"]'], // highly inconsistent in snapshots
257+
ignoreSelectors: ['[class^="bp_avatar_module_avatar--"] > [class^="bp_avatar_module_text--"]'],
253258
},
254259
msw: {
255260
handlers: [

src/utils/createTheme.stories.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,10 @@ export const ThemeExample = () => {
269269
export default {
270270
title: 'Theming/Theme',
271271
component: ThemeExample,
272-
parameters: { notes },
272+
parameters: {
273+
notes,
274+
chromatic: {
275+
disableSnapshot: true,
276+
},
277+
},
273278
};

0 commit comments

Comments
 (0)