test: fix theme switch test

pull/2571/head
Audric Ackermann 3 years ago
parent 37cedaf24a
commit 256672e5a3

@ -15,15 +15,17 @@ test('Switch themes', async () => {
windows = windowLoggedIn.windows; windows = windowLoggedIn.windows;
const [windowA] = windows; const [windowA] = windows;
// Check light theme colour is correct // Check light theme colour is correct
const lightThemeColor = windowA.locator('.inbox.index'); const darkThemeColor = windowA.locator('.inbox.index');
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)'); await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
// Click theme button and change to dark theme // Click theme button and change to dark theme
await clickOnTestIdWithText(windowA, 'theme-section'); await clickOnTestIdWithText(windowA, 'theme-section');
// Check background colour of background to verify dark theme // Check background colour of background to verify dark theme
const darkThemeColor = windowA.locator('.inbox.index'); const lightThemeColor = windowA.locator('.inbox.index');
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(23, 23, 23)'); await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)');
// Toggle back to light theme // Toggle back to light theme
await clickOnTestIdWithText(windowA, 'theme-section'); await clickOnTestIdWithText(windowA, 'theme-section');
// Check background colour again // Check background colour again
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)'); await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
}); });

Loading…
Cancel
Save