@@ -39,7 +39,8 @@ import {
3939 getTextByDataSupertokens ,
4040 sendEmailResetPasswordSuccessMessage ,
4141 setupBrowser ,
42- createCoreApp ,
42+ setupCoreApp ,
43+ setupST ,
4344 backendHook ,
4445 screenshotOnFailure ,
4546} from "../helpers" ;
@@ -53,6 +54,7 @@ describe("SuperTokens Account linking", function () {
5354 let browser ;
5455 let page ;
5556 let consoleLogs ;
57+ let coreUrl ;
5658
5759 const passwordlessFlowType = "USER_INPUT_CODE_AND_MAGIC_LINK" ;
5860 const passwordlessContactMethod = "EMAIL_OR_PHONE" ;
@@ -62,6 +64,9 @@ describe("SuperTokens Account linking", function () {
6264 if ( ! features . includes ( "accountlinking" ) ) {
6365 this . skip ( ) ;
6466 }
67+
68+ coreUrl = await setupCoreApp ( ) ;
69+ await setupST ( { coreUrl } ) ;
6570 } ) ;
6671
6772 describe ( "Recipe combination tests" , ( ) => {
@@ -118,7 +123,8 @@ describe("SuperTokens Account linking", function () {
118123 const doLogin2 = login2 [ 1 ] ;
119124
120125 it ( `should work for ${ login1 [ 0 ] } - ${ login2 [ 0 ] } w/ email verification not required` , async ( ) => {
121- await createCoreApp ( {
126+ await setupST ( {
127+ coreUrl,
122128 passwordlessFlowType,
123129 passwordlessContactMethod,
124130 accountLinkingConfig : {
@@ -158,7 +164,8 @@ describe("SuperTokens Account linking", function () {
158164
159165 if ( login2 [ 0 ] !== "emailpassword" ) {
160166 it ( `should work for ${ login1 [ 0 ] } - ${ login2 [ 0 ] } w/ email verification required` , async ( ) => {
161- await createCoreApp ( {
167+ await setupST ( {
168+ coreUrl,
162169 passwordlessFlowType,
163170 passwordlessContactMethod,
164171 accountLinkingConfig : {
@@ -212,7 +219,8 @@ describe("SuperTokens Account linking", function () {
212219 } ) ;
213220 } else {
214221 it ( `should work for ${ login1 [ 0 ] } - password reset (invite link flow) w/ email verification required` , async ( ) => {
215- await createCoreApp ( {
222+ await setupST ( {
223+ coreUrl,
216224 passwordlessFlowType,
217225 passwordlessContactMethod,
218226 accountLinkingConfig : {
@@ -272,7 +280,8 @@ describe("SuperTokens Account linking", function () {
272280
273281 describe ( "conflicting accounts" , ( ) => {
274282 it ( "should not allow sign up w/ emailpassword in case of conflict" , async function ( ) {
275- await createCoreApp ( {
283+ await setupST ( {
284+ coreUrl,
276285 passwordlessFlowType,
277286 passwordlessContactMethod,
278287 accountLinkingConfig : {
@@ -314,8 +323,9 @@ describe("SuperTokens Account linking", function () {
314323 it ( "should not allow sign in w/ an unverified emailpassword user in case of conflict" , async function ( ) {
315324 // Use a common appId over the test to allow re-inits
316325 const appId = randomUUID ( ) ;
317- await createCoreApp ( {
318- appId,
326+ const coreUrl = await setupCoreApp ( { appId } ) ;
327+ await setupST ( {
328+ coreUrl,
319329 passwordlessFlowType,
320330 passwordlessContactMethod,
321331 accountLinkingConfig : {
@@ -338,8 +348,8 @@ describe("SuperTokens Account linking", function () {
338348 await Promise . all ( [ page . waitForSelector ( ".sessionInfo-user-id" ) , page . waitForNetworkIdle ( ) ] ) ;
339349 await logOut ( page ) ;
340350
341- await createCoreApp ( {
342- appId ,
351+ await setupST ( {
352+ coreUrl ,
343353 passwordlessFlowType,
344354 passwordlessContactMethod,
345355 accountLinkingConfig : {
@@ -360,8 +370,8 @@ describe("SuperTokens Account linking", function () {
360370
361371 await waitForSTElement ( page , `input[name=email]` ) ;
362372
363- await createCoreApp ( {
364- appId ,
373+ await setupST ( {
374+ coreUrl ,
365375 passwordlessFlowType,
366376 passwordlessContactMethod,
367377 accountLinkingConfig : {
@@ -392,7 +402,8 @@ describe("SuperTokens Account linking", function () {
392402 } ) ;
393403
394404 it ( "should not allow sign up w/ an unverified thirdparty user in case of conflict" , async function ( ) {
395- await createCoreApp ( {
405+ await setupST ( {
406+ coreUrl,
396407 passwordlessFlowType,
397408 passwordlessContactMethod,
398409 accountLinkingConfig : {
@@ -426,7 +437,8 @@ describe("SuperTokens Account linking", function () {
426437 } ) ;
427438
428439 it ( "should not allow using thirdparty sign in with changed email in case of conflict" , async function ( ) {
429- await createCoreApp ( {
440+ await setupST ( {
441+ coreUrl,
430442 passwordlessFlowType,
431443 passwordlessContactMethod,
432444 accountLinkingConfig : {
@@ -480,8 +492,9 @@ describe("SuperTokens Account linking", function () {
480492 it ( "should not allow sign in w/ an unverified thirdparty user in case of conflict" , async function ( ) {
481493 // Use a common appId over the test to allow re-inits
482494 const appId = randomUUID ( ) ;
483- await createCoreApp ( {
484- appId,
495+ const coreUrl = await setupCoreApp ( { appId } ) ;
496+ await setupST ( {
497+ coreUrl,
485498 passwordlessFlowType,
486499 passwordlessContactMethod,
487500 accountLinkingConfig : {
@@ -500,8 +513,8 @@ describe("SuperTokens Account linking", function () {
500513 await tryThirdPartySignInUp ( page , email , false ) ;
501514 await logOut ( page ) ;
502515
503- await createCoreApp ( {
504- appId ,
516+ await setupST ( {
517+ coreUrl ,
505518 passwordlessFlowType,
506519 passwordlessContactMethod,
507520 accountLinkingConfig : {
@@ -522,8 +535,8 @@ describe("SuperTokens Account linking", function () {
522535
523536 await waitForSTElement ( page , `input[name=email]` ) ;
524537
525- await createCoreApp ( {
526- appId ,
538+ await setupST ( {
539+ coreUrl ,
527540 passwordlessFlowType,
528541 passwordlessContactMethod,
529542 accountLinkingConfig : {
@@ -549,8 +562,9 @@ describe("SuperTokens Account linking", function () {
549562
550563 // Use a common appId over the test to allow re-inits
551564 const appId = randomUUID ( ) ;
552- await createCoreApp ( {
553- appId,
565+ const coreUrl = await setupCoreApp ( { appId } ) ;
566+ await setupST ( {
567+ coreUrl,
554568 passwordlessFlowType,
555569 passwordlessContactMethod,
556570 accountLinkingConfig : {
@@ -565,8 +579,8 @@ describe("SuperTokens Account linking", function () {
565579 await tryEmailPasswordSignUp ( page , email ) ;
566580 await logOut ( page ) ;
567581
568- await createCoreApp ( {
569- appId ,
582+ await setupST ( {
583+ coreUrl ,
570584 passwordlessFlowType,
571585 passwordlessContactMethod,
572586 accountLinkingConfig : {
@@ -598,8 +612,9 @@ describe("SuperTokens Account linking", function () {
598612 const email = `test-user+${ Date . now ( ) } @supertokens.com` ;
599613 // Use a common appId over the test to allow re-inits
600614 const appId = randomUUID ( ) ;
601- await createCoreApp ( {
602- appId,
615+ const coreUrl = await setupCoreApp ( { appId } ) ;
616+ await setupST ( {
617+ coreUrl,
603618 passwordlessFlowType,
604619 passwordlessContactMethod,
605620 accountLinkingConfig : {
@@ -614,8 +629,8 @@ describe("SuperTokens Account linking", function () {
614629 await tryEmailPasswordSignUp ( page , email ) ;
615630 await logOut ( page ) ;
616631
617- await createCoreApp ( {
618- appId ,
632+ await setupST ( {
633+ coreUrl ,
619634 passwordlessFlowType,
620635 passwordlessContactMethod,
621636 accountLinkingConfig : {
@@ -649,8 +664,9 @@ describe("SuperTokens Account linking", function () {
649664
650665 // Use a common appId over the test to allow re-inits
651666 const appId = randomUUID ( ) ;
652- await createCoreApp ( {
653- appId,
667+ const coreUrl = await setupCoreApp ( { appId } ) ;
668+ await setupST ( {
669+ coreUrl,
654670 passwordlessFlowType,
655671 passwordlessContactMethod,
656672 accountLinkingConfig : {
@@ -673,8 +689,8 @@ describe("SuperTokens Account linking", function () {
673689 await tryThirdPartySignInUp ( page , email , false , email2 ) ;
674690 await logOut ( page ) ;
675691
676- await createCoreApp ( {
677- appId ,
692+ await setupST ( {
693+ coreUrl ,
678694 passwordlessFlowType,
679695 passwordlessContactMethod,
680696 accountLinkingConfig : {
@@ -689,8 +705,8 @@ describe("SuperTokens Account linking", function () {
689705 await tryEmailPasswordSignUp ( page , email ) ;
690706 await logOut ( page ) ;
691707
692- await createCoreApp ( {
693- appId ,
708+ await setupST ( {
709+ coreUrl ,
694710 passwordlessFlowType,
695711 passwordlessContactMethod,
696712 accountLinkingConfig : {
@@ -724,8 +740,9 @@ describe("SuperTokens Account linking", function () {
724740
725741 // Use a common appId over the test to allow re-inits
726742 const appId = randomUUID ( ) ;
727- await createCoreApp ( {
728- appId,
743+ const coreUrl = await setupCoreApp ( { appId } ) ;
744+ await setupST ( {
745+ coreUrl,
729746 passwordlessFlowType,
730747 passwordlessContactMethod,
731748 accountLinkingConfig : {
@@ -750,8 +767,8 @@ describe("SuperTokens Account linking", function () {
750767
751768 await logOut ( page ) ;
752769
753- await createCoreApp ( {
754- appId ,
770+ await setupST ( {
771+ coreUrl ,
755772 passwordlessFlowType,
756773 passwordlessContactMethod,
757774 accountLinkingConfig : {
@@ -772,8 +789,8 @@ describe("SuperTokens Account linking", function () {
772789
773790 await waitForSTElement ( page , `input[name=email]` ) ;
774791
775- await createCoreApp ( {
776- appId ,
792+ await setupST ( {
793+ coreUrl ,
777794 passwordlessFlowType,
778795 passwordlessContactMethod,
779796 accountLinkingConfig : {
0 commit comments