@@ -25,11 +25,15 @@ const mockClaimedInstanceEnvironmentCall = async (page: Page) => {
2525test . describe ( 'Keyless mode @quickstart' , ( ) => {
2626 test . describe . configure ( { mode : 'serial' } ) ;
2727 let app : Application ;
28+ let dashboardUrl = 'https://dashboard.clerk.com/' ;
2829
2930 test . beforeAll ( async ( ) => {
3031 app = await commonSetup . commit ( ) ;
3132 await app . setup ( ) ;
3233 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+ }
3337 await app . dev ( ) ;
3438 } ) ;
3539
@@ -74,7 +78,7 @@ test.describe('Keyless mode @quickstart', () => {
7478
7579 await newPage . waitForLoadState ( ) ;
7680 await newPage . waitForURL ( url => {
77- const urlToReturnTo = 'https://dashboard.clerk.com/ apps/claim?token=' ;
81+ const urlToReturnTo = ` ${ dashboardUrl } apps/claim?token=` ;
7882 return (
7983 url . pathname === '/apps/claim/sign-in' &&
8084 url . searchParams . get ( 'sign_in_force_redirect_url' ) ?. startsWith ( urlToReturnTo ) &&
@@ -102,11 +106,9 @@ test.describe('Keyless mode @quickstart', () => {
102106 ] ) ;
103107
104108 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+ } ) ;
110112 } ) ;
111113
112114 test ( 'Claimed application with keys inside .env, on dismiss, keyless prompt is removed.' , async ( {
0 commit comments