@@ -3,6 +3,7 @@ import { SnippetsTestHelper } from './helpers/SnippetsTestHelper'
33import { SELECTORS } from './helpers/constants'
44
55const TEST_SNIPPET_NAME = 'E2E List Test Snippet'
6+ const MAX_DIFF_PIXEL_RATIO = 0.1
67
78test . describe ( 'Code Snippets List Page Actions' , ( ) => {
89 let helper : SnippetsTestHelper
@@ -29,7 +30,7 @@ test.describe('Code Snippets List Page Actions', () => {
2930 await expect ( toggleSwitch ) . toHaveAttribute ( 'title' , 'Deactivate' )
3031
3132 // Check that the toggle is rendered to the right (active)
32- await expect ( snippetRow ) . toHaveScreenshot ( 'snippet-row-active.png' )
33+ await expect ( snippetRow ) . toHaveScreenshot ( 'snippet-row-active.png' , { maxDiffPixelRatio : MAX_DIFF_PIXEL_RATIO } )
3334
3435 await toggleSwitch . click ( )
3536 await page . waitForLoadState ( 'networkidle' )
@@ -39,7 +40,7 @@ test.describe('Code Snippets List Page Actions', () => {
3940 await expect ( updatedToggle ) . toHaveAttribute ( 'title' , 'Activate' )
4041
4142 // Check that the toggle is rendered to the left (inactive)
42- await expect ( updatedRow ) . toHaveScreenshot ( 'snippet-row-inactive.png' )
43+ await expect ( updatedRow ) . toHaveScreenshot ( 'snippet-row-inactive.png' , { maxDiffPixelRatio : MAX_DIFF_PIXEL_RATIO } )
4344
4445 await updatedToggle . click ( )
4546 await page . waitForLoadState ( 'networkidle' )
0 commit comments