Skip to content

Commit 246cc91

Browse files
authored
Merge pull request #310 from codesnippetspro/fix/toggle-style
fix: toggle style issue
2 parents 2a8dcc6 + 9de3e03 commit 246cc91

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

src/css/manage.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@use 'common/theme';
88
@use 'common/badges';
99
@use 'common/switch';
10+
@use 'common/direction';
1011
@use 'common/select';
1112
@use 'manage/cloud';
1213

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@ test.describe('Code Snippets List Page Actions', () => {
2828

2929
await expect(toggleSwitch).toHaveAttribute('title', 'Deactivate')
3030

31+
// Check that the toggle is rendered to the right (active)
32+
await expect(snippetRow).toHaveScreenshot('snippet-row-active.png')
33+
3134
await toggleSwitch.click()
3235
await page.waitForLoadState('networkidle')
3336

3437
const updatedRow = page.locator(`tr:has-text("${TEST_SNIPPET_NAME}")`)
3538
const updatedToggle = updatedRow.locator('a.snippet-activation-switch')
3639
await expect(updatedToggle).toHaveAttribute('title', 'Activate')
3740

41+
// Check that the toggle is rendered to the left (inactive)
42+
await expect(updatedRow).toHaveScreenshot('snippet-row-inactive.png')
43+
3844
await updatedToggle.click()
3945
await page.waitForLoadState('networkidle')
4046

7.26 KB
Loading
7.42 KB
Loading

tests/playwright/playwright.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const WORKERS = 1
1010
*/
1111
export default defineConfig({
1212
testDir: '../e2e',
13+
snapshotPathTemplate: '{testDir}/{testFileDir}/{testFileName}-snapshots/{arg}-{platform}{ext}',
1314
fullyParallel: true,
1415
forbidOnly: !!process.env.CI,
1516
retries: process.env.CI ? RETRIES : 0,
@@ -66,6 +67,7 @@ export default defineConfig({
6667
timeout: 30000,
6768

6869
expect: {
69-
timeout: 10000
70+
timeout: 10000,
71+
toHaveScreenshot: { maxDiffPixels: 100 }
7072
}
7173
})

0 commit comments

Comments
 (0)