-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
733 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TestRunnerConfig, waitForPageReady } from "@storybook/test-runner"; | ||
import { toMatchImageSnapshot } from "jest-image-snapshot"; | ||
import path from "path"; | ||
|
||
const customSnapshotsDir = path.join(process.cwd(), "__image_snapshots__"); | ||
|
||
const config: TestRunnerConfig = { | ||
setup() { | ||
expect.extend({ toMatchImageSnapshot }); | ||
}, | ||
async postVisit(page, context) { | ||
// Wait for the page to be ready before taking a screenshot | ||
await waitForPageReady(page); | ||
|
||
// Wait an extra second for transitions to complete | ||
await page.waitForTimeout(1000); | ||
|
||
// Get the story's container element - selecting the nested content div | ||
const storyContainer = await page.$("#storybook-root > div > div"); | ||
if (!storyContainer) { | ||
throw new Error("Could not find story content element"); | ||
} | ||
|
||
// Get browser name to handle different browsers if needed | ||
const browserName = | ||
page.context().browser()?.browserType().name() ?? "unknown"; | ||
|
||
// Take screenshot of just the story container | ||
const image = await storyContainer.screenshot(); | ||
expect(image).toMatchImageSnapshot({ | ||
customSnapshotsDir, | ||
customSnapshotIdentifier: `${context.id}-${browserName}`, | ||
// Add some threshold to handle minor rendering differences | ||
failureThreshold: 0.01, | ||
failureThresholdType: "percent", | ||
}); | ||
}, | ||
}; | ||
|
||
export default config; |
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 @@ | ||
__diff_output__ |
Binary file added
BIN
+18.2 KB
...eychain/__image_snapshots__/components-confirmtransaction--default-chromium.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
+18.6 KB
...chain/__image_snapshots__/components-connect-authenticate--default-chromium.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
+24.4 KB
...ge_snapshots__/components-connect-create-createcontroller--default-chromium.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
+25.2 KB
...s__/components-connect-create-createcontroller--with-generic-error-chromium.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
+24.4 KB
...hots__/components-connect-create-createcontroller--with-light-mode-chromium.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
+83.8 KB
...snapshots__/components-connect-create-createcontroller--with-theme-chromium.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
+31.4 KB
...s__/components-connect-create-createcontroller--with-timeout-error-chromium.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
+27.1 KB
.../components-connect-create-createcontroller--with-validation-error-chromium.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
+76.2 KB
...hain/__image_snapshots__/components-connect-createsession--default-chromium.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
+67 KB
.../__image_snapshots__/components-connect-createsession--with-preset-chromium.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
+17.1 KB
...s/keychain/__image_snapshots__/components-connect-upgrade--default-chromium.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
+2.25 KB
.../keychain/__image_snapshots__/components-controllererroralert--all-chromium.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
+18.5 KB
.../keychain/__image_snapshots__/components-deploycontroller--default-chromium.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
+14.4 KB
packages/keychain/__image_snapshots__/components-erroralert--default-chromium.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
+14.4 KB
packages/keychain/__image_snapshots__/components-erroralert--error-chromium.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
+14.7 KB
packages/keychain/__image_snapshots__/components-erroralert--info-chromium.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 KB
...ges/keychain/__image_snapshots__/components-erroralert--long-title-chromium.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
+14.6 KB
packages/keychain/__image_snapshots__/components-erroralert--warning-chromium.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
+23.8 KB
packages/keychain/__image_snapshots__/components-errorpage--default-chromium.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
+33.3 KB
...ages/keychain/__image_snapshots__/components-errorpage--long-error-chromium.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.9 KB
packages/keychain/__image_snapshots__/components-failure--default-chromium.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
+14.9 KB
packages/keychain/__image_snapshots__/components-funding--default-chromium.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
+2.57 KB
..._snapshots__/components-layout-container-header-banner--compressed-chromium.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
+12 KB
...ge_snapshots__/components-layout-container-header-banner--expanded-chromium.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
+7.8 KB
packages/keychain/__image_snapshots__/components-pending--default-chromium.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
+4.72 KB
packages/keychain/__image_snapshots__/components-settings--default-chromium.png
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { TestRunnerConfig, waitForPageReady } from "@storybook/test-runner"; | ||
import { toMatchImageSnapshot } from "jest-image-snapshot"; | ||
import path from "path"; | ||
|
||
const customSnapshotsDir = path.join(process.cwd(), "__image_snapshots__"); | ||
|
||
const config: TestRunnerConfig = { | ||
setup() { | ||
expect.extend({ toMatchImageSnapshot }); | ||
}, | ||
async postVisit(page, context) { | ||
// Wait for the page to be ready before taking a screenshot | ||
await waitForPageReady(page); | ||
|
||
// Get the story's container element - selecting the nested content div | ||
const storyContainer = await page.$("#storybook-root > *"); | ||
if (!storyContainer) { | ||
throw new Error("Could not find story content element"); | ||
} | ||
|
||
// Get browser name to handle different browsers if needed | ||
const browserName = | ||
page.context().browser()?.browserType().name() ?? "unknown"; | ||
|
||
// Take screenshot of just the story container | ||
const image = await storyContainer.screenshot(); | ||
expect(image).toMatchImageSnapshot({ | ||
customSnapshotsDir, | ||
customSnapshotIdentifier: `${context.id}-${browserName}`, | ||
// Add some threshold to handle minor rendering differences | ||
failureThreshold: 0.01, | ||
failureThresholdType: "percent", | ||
}); | ||
}, | ||
}; | ||
|
||
export default config; |
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 @@ | ||
__diff_output__ |
Oops, something went wrong.
Binary file added
BIN
+6.15 KB
packages/ui-next/__image_snapshots__/alert--alert-destructive-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+3.8 KB
packages/ui-next/__image_snapshots__/breadcrumb--custom-separator-chromium.png
Oops, something went wrong.
Binary file added
BIN
+3.78 KB
packages/ui-next/__image_snapshots__/breadcrumb--default-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+10.1 KB
packages/ui-next/__image_snapshots__/colors--destructive-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+8.13 KB
...es/ui-next/__image_snapshots__/components-primitives-form--default-chromium.png
Oops, something went wrong.
Binary file added
BIN
+1.59 KB
packages/ui-next/__image_snapshots__/copyaddress--default-chromium.png
Oops, something went wrong.
Binary file added
BIN
+1.58 KB
packages/ui-next/__image_snapshots__/copyaddress--explicit-length-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+1.02 KB
packages/ui-next/__image_snapshots__/dialog--alert-dialog-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+1.02 KB
packages/ui-next/__image_snapshots__/dropdown-menu--default-chromium.png
Oops, something went wrong.
Binary file added
BIN
+935 Bytes
packages/ui-next/__image_snapshots__/hover-card--default-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+305 Bytes
packages/ui-next/__image_snapshots__/progress--default-chromium.png
Oops, something went wrong.
Binary file added
BIN
+3.49 KB
packages/ui-next/__image_snapshots__/radio-group--default-chromium.png
Oops, something went wrong.
Binary file added
BIN
+23.3 KB
packages/ui-next/__image_snapshots__/scroll-area--default-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+102 Bytes
packages/ui-next/__image_snapshots__/separator--default-chromium.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+1.17 KB
packages/ui-next/__image_snapshots__/toggle-group--default-chromium.png
Oops, something went wrong.
Oops, something went wrong.
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
Oops, something went wrong.