Skip to content

Commit 256672e

Browse files
committed
test: fix theme switch test
1 parent 37cedaf commit 256672e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ts/test/automation/switching_theme.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ test('Switch themes', async () => {
1515
windows = windowLoggedIn.windows;
1616
const [windowA] = windows;
1717
// Check light theme colour is correct
18-
const lightThemeColor = windowA.locator('.inbox.index');
19-
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)');
18+
const darkThemeColor = windowA.locator('.inbox.index');
19+
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
20+
2021
// Click theme button and change to dark theme
2122
await clickOnTestIdWithText(windowA, 'theme-section');
2223
// Check background colour of background to verify dark theme
23-
const darkThemeColor = windowA.locator('.inbox.index');
24-
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(23, 23, 23)');
24+
const lightThemeColor = windowA.locator('.inbox.index');
25+
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)');
26+
2527
// Toggle back to light theme
2628
await clickOnTestIdWithText(windowA, 'theme-section');
2729
// Check background colour again
28-
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)');
30+
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
2931
});

0 commit comments

Comments
 (0)