Skip to content

Commit e36df07

Browse files
add test for dark mode
1 parent fe06be3 commit e36df07

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
43 KB
Loading

packages/devextreme-cli/testing/app-template.test.shared.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module.exports = (env) => {
7676
}
7777

7878
const customConfig = { threshold: 0.012 };
79+
7980
function compareSnapshot(image, name) {
8081
expect(image).toMatchImageSnapshot({
8182
customDiffConfig: customConfig,
@@ -86,6 +87,15 @@ module.exports = (env) => {
8687
});
8788
}
8889

90+
async function compareThemeModeSnapshot(name) {
91+
await page.click('.dx-button.theme-button');
92+
await page.waitForTimeout(500);
93+
94+
const image = await takeScreenshot();
95+
96+
compareSnapshot(image, name + '-dark');
97+
}
98+
8999
async function hideScroll() {
90100
await page.evaluate(() => {
91101
// eslint-disable-next-line no-undef
@@ -159,9 +169,11 @@ module.exports = (env) => {
159169
await openPage(`${appUrl}#/profile`);
160170

161171
await page.waitForTimeout(3000);
162-
const image = await takeScreenshot();
172+
let image = await takeScreenshot();
163173

164174
compareSnapshot(image, 'profile');
175+
176+
await compareThemeModeSnapshot('profile');
165177
});
166178

167179
it('Tasks view', async() => {

0 commit comments

Comments
 (0)