File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,22 @@ import isChromatic from "chromatic/isChromatic";
66import { UI_THEME_KEY } from "@/common/constants/storage" ;
77import "../src/browser/styles/globals.css" ;
88
9+ const isAutomatedChromaticRun = ( ) => {
10+ if ( typeof window === "undefined" || ! isChromatic ( ) ) {
11+ return false ;
12+ }
13+ if ( typeof navigator === "undefined" ) {
14+ return true ;
15+ }
16+ if ( "webdriver" in navigator ) {
17+ return Boolean ( navigator . webdriver ) ;
18+ }
19+ return true ;
20+ } ;
21+
922// Utility: detect e2e/test contexts where UI should be hidden (Chromatic, SB test-runner)
1023const isE2ETestEnv = ( ) => {
11- if ( typeof window !== "undefined" && isChromatic ( ) ) {
24+ if ( isAutomatedChromaticRun ( ) ) {
1225 return true ;
1326 }
1427 if ( typeof navigator !== "undefined" && / S t o r y b o o k T e s t R u n n e r / i. test ( navigator . userAgent ) ) {
You can’t perform that action at this time.
0 commit comments