@@ -123,33 +123,33 @@ describe('Clerk singleton - Redirects', () => {
123
123
} ) ;
124
124
125
125
it ( 'redirects to signInUrl for development instance' , async ( ) => {
126
- await clerkForDevelopmentInstance . redirectToSignIn ( { redirectUrl : 'https://www. example.com/ ' } ) ;
126
+ await clerkForDevelopmentInstance . redirectToSignIn ( { redirectUrl : '/ example' } ) ;
127
127
expect ( mockNavigate ) . toHaveBeenCalledWith (
128
- '/sign-in#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ' ,
128
+ '/sign-in#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ' ,
129
129
undefined ,
130
130
) ;
131
131
} ) ;
132
132
133
133
it ( 'redirects to signInUrl for production instance' , async ( ) => {
134
- await clerkForProductionInstance . redirectToSignIn ( { redirectUrl : 'https://www. example.com/ ' } ) ;
134
+ await clerkForProductionInstance . redirectToSignIn ( { redirectUrl : '/ example' } ) ;
135
135
expect ( mockNavigate ) . toHaveBeenCalledWith (
136
- '/sign-in#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ' ,
136
+ '/sign-in#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ' ,
137
137
undefined ,
138
138
) ;
139
139
} ) ;
140
140
141
141
it ( 'redirects to signUpUrl for development instance' , async ( ) => {
142
- await clerkForDevelopmentInstance . redirectToSignUp ( { redirectUrl : 'https://www. example.com/ ' } ) ;
142
+ await clerkForDevelopmentInstance . redirectToSignUp ( { redirectUrl : '/ example' } ) ;
143
143
expect ( mockNavigate ) . toHaveBeenCalledWith (
144
- '/sign-up#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ' ,
144
+ '/sign-up#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ' ,
145
145
undefined ,
146
146
) ;
147
147
} ) ;
148
148
149
149
it ( 'redirects to signUpUrl for production instance' , async ( ) => {
150
- await clerkForProductionInstance . redirectToSignUp ( { redirectUrl : 'https://www. example.com/ ' } ) ;
150
+ await clerkForProductionInstance . redirectToSignUp ( { redirectUrl : '/ example' } ) ;
151
151
expect ( mockNavigate ) . toHaveBeenCalledWith (
152
- '/sign-up#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ' ,
152
+ '/sign-up#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ' ,
153
153
undefined ,
154
154
) ;
155
155
} ) ;
@@ -220,31 +220,31 @@ describe('Clerk singleton - Redirects', () => {
220
220
const host = 'http://another-test.host' ;
221
221
222
222
it ( 'redirects to signInUrl for development instance' , async ( ) => {
223
- await clerkForDevelopmentInstance . redirectToSignIn ( { redirectUrl : 'https://www. example.com/ ' } ) ;
223
+ await clerkForDevelopmentInstance . redirectToSignIn ( { redirectUrl : '/ example' } ) ;
224
224
expect ( mockHref ) . toHaveBeenCalledTimes ( 1 ) ;
225
225
expect ( mockHref ) . toHaveBeenCalledWith (
226
- `${ host } /sign-in?__clerk_db_jwt=deadbeef#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ` ,
226
+ `${ host } /sign-in?__clerk_db_jwt=deadbeef#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ` ,
227
227
) ;
228
228
} ) ;
229
229
230
230
it ( 'redirects to signInUrl for production instance' , async ( ) => {
231
- await clerkForProductionInstance . redirectToSignIn ( { redirectUrl : 'https://www. example.com/ ' } ) ;
231
+ await clerkForProductionInstance . redirectToSignIn ( { redirectUrl : '/ example' } ) ;
232
232
expect ( mockHref ) . toHaveBeenCalledTimes ( 1 ) ;
233
- expect ( mockHref ) . toHaveBeenCalledWith ( `${ host } /sign-in#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ` ) ;
233
+ expect ( mockHref ) . toHaveBeenCalledWith ( `${ host } /sign-in#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ` ) ;
234
234
} ) ;
235
235
236
236
it ( 'redirects to signUpUrl for development instance' , async ( ) => {
237
- await clerkForDevelopmentInstance . redirectToSignUp ( { redirectUrl : 'https://www. example.com/ ' } ) ;
237
+ await clerkForDevelopmentInstance . redirectToSignUp ( { redirectUrl : '/ example' } ) ;
238
238
expect ( mockHref ) . toHaveBeenCalledTimes ( 1 ) ;
239
239
expect ( mockHref ) . toHaveBeenCalledWith (
240
- `${ host } /sign-up?__clerk_db_jwt=deadbeef#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ` ,
240
+ `${ host } /sign-up?__clerk_db_jwt=deadbeef#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ` ,
241
241
) ;
242
242
} ) ;
243
243
244
244
it ( 'redirects to signUpUrl for production instance' , async ( ) => {
245
- await clerkForProductionInstance . redirectToSignUp ( { redirectUrl : 'https://www. example.com/ ' } ) ;
245
+ await clerkForProductionInstance . redirectToSignUp ( { redirectUrl : '/ example' } ) ;
246
246
expect ( mockHref ) . toHaveBeenCalledTimes ( 1 ) ;
247
- expect ( mockHref ) . toHaveBeenCalledWith ( `${ host } /sign-up#/?redirect_url=https %3A%2F%2Fwww.example.com%2F ` ) ;
247
+ expect ( mockHref ) . toHaveBeenCalledWith ( `${ host } /sign-up#/?redirect_url=http %3A%2F%2Ftest.host%2Fexample ` ) ;
248
248
} ) ;
249
249
250
250
it ( 'redirects to userProfileUrl' , async ( ) => {
0 commit comments