Skip to content

Commit

Permalink
Add dark snapshots to storybook tests (#4928)
Browse files Browse the repository at this point in the history
* Add dark storybook snapshots

* Update frontend/test/playwright/utils/expect-snapshot.ts
  • Loading branch information
obulat authored Sep 25, 2024
1 parent 684c0dd commit af8b89f
Show file tree
Hide file tree
Showing 93 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions frontend/test/playwright/utils/expect-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const expectSnapshot: ExpectSnapshot = async (
page,
name,
screenshotAble,
{ screenshotOptions, snapshotOptions, useColorMode, dir } = {}
{ screenshotOptions, snapshotOptions, useColorMode = true, dir } = {}
) => {
// Hide the theme switcher before taking the screenshot.
screenshotOptions = {
Expand All @@ -89,9 +89,10 @@ export const expectSnapshot: ExpectSnapshot = async (
.soft(await screenshotAble.screenshot(screenshotOptions))
.toMatchSnapshot(getSnapshotName(name, "light"), snapshotOptions)

if (!(useColorMode === true)) {
if (!useColorMode) {
return
}

await turnOnDarkMode(page, dir ?? "ltr")

// Wait for the theme to change.
Expand Down
7 changes: 1 addition & 6 deletions frontend/test/storybook/visual-regression/focus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ const goTo = async (page: Page, slug: string) => {
await page.goto(`/iframe.html?id=meta-focus--${slug}`)
}

const allSlugs = [
"slim-transparent",
"slim-filled",
"slim-filled-borderless",
"bold-filled",
]
const allSlugs = ["slim-transparent", "slim-filled", "bold-filled"]

test.describe.configure({ mode: "parallel" })

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit af8b89f

Please sign in to comment.