Skip to content

Commit 18edd76

Browse files
committed
add screenshots
1 parent a02ed71 commit 18edd76

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/e2e/code-snippets-list.spec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ test.describe('Code Snippets List Page Actions', () => {
2929
await expect(toggleSwitch).toHaveAttribute('title', 'Deactivate')
3030

3131
// Check that the toggle is rendered to the right (active)
32-
const activeTransform = await toggleSwitch.evaluate(el => {
33-
return window.getComputedStyle(el, '::before').transform
34-
})
35-
expect(activeTransform).toBe('matrix(1, 0, 0, 1, 13, 0)')
32+
await expect(snippetRow).toHaveScreenshot('snippet-row-active.png')
3633

3734
await toggleSwitch.click()
3835
await page.waitForLoadState('networkidle')
@@ -42,10 +39,7 @@ test.describe('Code Snippets List Page Actions', () => {
4239
await expect(updatedToggle).toHaveAttribute('title', 'Activate')
4340

4441
// Check that the toggle is rendered to the left (inactive)
45-
const inactiveTransform = await updatedToggle.evaluate(el => {
46-
return window.getComputedStyle(el, '::before').transform
47-
})
48-
expect(inactiveTransform).toBe('none')
42+
await expect(updatedRow).toHaveScreenshot('snippet-row-inactive.png')
4943

5044
await updatedToggle.click()
5145
await page.waitForLoadState('networkidle')

0 commit comments

Comments
 (0)