-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from RyanClementsHax/playwright
Add more e2e tests
- Loading branch information
Showing
23 changed files
with
150 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { expect } from '@playwright/test' | ||
import { test } from '../test_repos/test' | ||
|
||
test('can enable a theme using a media query', async ({ page, testRepo }) => { | ||
await testRepo.openWithConfig({ | ||
defaultTheme: { | ||
extend: { | ||
colors: { | ||
primary: 'blue' | ||
} | ||
} | ||
}, | ||
themes: [ | ||
{ | ||
name: 'darkTheme', | ||
mediaQuery: '@media (prefers-color-scheme: dark)', | ||
extend: { | ||
colors: { | ||
primary: 'red' | ||
} | ||
} | ||
} | ||
] | ||
}) | ||
|
||
await page.emulateMedia({ colorScheme: 'dark' }) | ||
|
||
await expect(page).toHaveScreenshot() | ||
}) | ||
|
||
// TODO fix this test's snapshots | ||
test('cant enable a theme using the theme name as a class if a media query provided', async ({ | ||
page, | ||
testRepo | ||
}) => { | ||
await testRepo.openWithConfig({ | ||
defaultTheme: { | ||
extend: { | ||
colors: { | ||
primary: 'blue' | ||
} | ||
} | ||
}, | ||
themes: [ | ||
{ | ||
name: 'darkTheme', | ||
mediaQuery: '@media (prefers-color-scheme: dark)', | ||
extend: { | ||
colors: { | ||
primary: 'red' | ||
} | ||
} | ||
} | ||
] | ||
}) | ||
|
||
await testRepo.setClassOnRoot('darkTheme') | ||
|
||
await expect(page).toHaveScreenshot() | ||
}) |
Binary file added
BIN
+14.7 KB
...y.spec.ts-snapshots/can-enable-a-theme-using-a-media-query-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.4 KB
...ry.spec.ts-snapshots/can-enable-a-theme-using-a-media-query-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
...ery.spec.ts-snapshots/can-enable-a-theme-using-a-media-query-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.7 KB
...-using-the-theme-name-as-a-class-if-a-media-query-provided-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35 KB
...e-using-the-theme-name-as-a-class-if-a-media-query-provided-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.9 KB
...me-using-the-theme-name-as-a-class-if-a-media-query-provided-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-3.97 KB
(82%)
....ts-snapshots/can-enable-the-theme-with-multiple-selectors-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.58 KB
(90%)
...c.ts-snapshots/can-enable-the-theme-with-multiple-selectors-2-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.33 KB
(87%)
...ec.ts-snapshots/can-enable-the-theme-with-multiple-selectors-2-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21 KB
....ts-snapshots/can-enable-the-theme-with-multiple-selectors-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.4 KB
...c.ts-snapshots/can-enable-the-theme-with-multiple-selectors-3-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.9 KB
...ec.ts-snapshots/can-enable-the-theme-with-multiple-selectors-3-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.7 KB
...-using-the-theme-name-as-a-class-if-any-selectors-provided-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35 KB
...e-using-the-theme-name-as-a-class-if-any-selectors-provided-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.9 KB
...me-using-the-theme-name-as-a-class-if-any-selectors-provided-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.