@@ -25,11 +25,15 @@ const mockClaimedInstanceEnvironmentCall = async (page: Page) => {
25
25
test . describe ( 'Keyless mode @quickstart' , ( ) => {
26
26
test . describe . configure ( { mode : 'serial' } ) ;
27
27
let app : Application ;
28
+ let dashboardUrl = 'https://dashboard.clerk.com/' ;
28
29
29
30
test . beforeAll ( async ( ) => {
30
31
app = await commonSetup . commit ( ) ;
31
32
await app . setup ( ) ;
32
33
await app . withEnv ( appConfigs . envs . withKeyless ) ;
34
+ if ( appConfigs . envs . withKeyless . privateVariables . get ( 'CLERK_API_URL' ) ?. includes ( 'clerkstage' ) ) {
35
+ dashboardUrl = 'https://dashboard.clerkstage.dev/' ;
36
+ }
33
37
await app . dev ( ) ;
34
38
} ) ;
35
39
@@ -74,7 +78,7 @@ test.describe('Keyless mode @quickstart', () => {
74
78
75
79
await newPage . waitForLoadState ( ) ;
76
80
await newPage . waitForURL ( url => {
77
- const urlToReturnTo = 'https://dashboard.clerk.com/ apps/claim?token=' ;
81
+ const urlToReturnTo = ` ${ dashboardUrl } apps/claim?token=` ;
78
82
return (
79
83
url . pathname === '/apps/claim/sign-in' &&
80
84
url . searchParams . get ( 'sign_in_force_redirect_url' ) ?. startsWith ( urlToReturnTo ) &&
@@ -102,11 +106,9 @@ test.describe('Keyless mode @quickstart', () => {
102
106
] ) ;
103
107
104
108
await newPage . waitForLoadState ( ) ;
105
- await newPage . waitForURL ( url =>
106
- url . href . startsWith (
107
- 'https://dashboard.clerk.com/sign-in?redirect_url=https%3A%2F%2Fdashboard.clerk.com%2Fapps%2Fapp_' ,
108
- ) ,
109
- ) ;
109
+ await newPage . waitForURL ( url => {
110
+ return url . href . startsWith ( `${ dashboardUrl } sign-in?redirect_url=${ encodeURIComponent ( dashboardUrl ) } apps%2Fapp_` ) ;
111
+ } ) ;
110
112
} ) ;
111
113
112
114
test ( 'Claimed application with keys inside .env, on dismiss, keyless prompt is removed.' , async ( {
0 commit comments