diff --git a/react/__snapshots__/examples.spec.jsx.snap b/react/__snapshots__/examples.spec.jsx.snap index 832ffd06c4..5e51861e1a 100644 --- a/react/__snapshots__/examples.spec.jsx.snap +++ b/react/__snapshots__/examples.spec.jsx.snap @@ -2311,7 +2311,7 @@ exports[`Field should render examples: Field 14`] = `
-
+
@@ -6662,7 +6662,7 @@ exports[`Infos should render examples: Infos 1`] = `
-
+
" @@ -6685,7 +6685,7 @@ exports[`InfosCarrousel should render examples: InfosCarrousel 1`] = `
-
+
@@ -6699,12 +6699,12 @@ exports[`InfosCarrousel should render examples: InfosCarrousel 1`] = `
-
+
-
+
" @@ -7013,13 +7013,13 @@ exports[`MuiCozyTheme/Switch should render examples: MuiCozyTheme/Switch 1`] = `

Primary

-
+

Secondary

-
+
diff --git a/test/testFromStyleguidist.js b/test/testFromStyleguidist.js index 5013874eef..30fdcdd2b6 100644 --- a/test/testFromStyleguidist.js +++ b/test/testFromStyleguidist.js @@ -43,6 +43,12 @@ const testFromStyleguidist = ( } } + // TouchRipples can cause flaky tests + const touchRippleRx = /<\/span>/g + const removeTouchRipples = html => { + return html.replace(touchRippleRx, '') + } + describe(name, () => { it('should render examples', done => { let doneCounter = 0 @@ -64,7 +70,7 @@ const testFromStyleguidist = ( await sleep(delay) // some components (like the ActionMenu) are flaky due to external libs requestAnimationFrame(() => { root.update() - rendered.push(pretty(root.html())) + rendered.push(pretty(removeTouchRipples(root.html()))) doneCounter++ if (doneCounter === codes.length) { finish()