@@ -323,95 +323,6 @@ describe("SuperTokens SignIn w/ MFA", function () {
323323 }
324324 } ) ;
325325
326- it ( "should handle consumeCode restart flow error" , async ( ) => {
327- await setupST ( {
328- ...appConfig ,
329- mfaInfo : {
330- requirements : [ factorId ] ,
331- alreadySetup : [ factorId ] ,
332- allowedToSetup : [ factorId ] ,
333- } ,
334- } ) ;
335-
336- await page . setRequestInterception ( true ) ;
337- const requestHandler = ( request ) => {
338- if ( request . url ( ) === CONSUME_CODE_API && request . method ( ) === "POST" ) {
339- return request . respond ( {
340- status : 200 ,
341- headers : {
342- "access-control-allow-origin" : TEST_CLIENT_BASE_URL ,
343- "access-control-allow-credentials" : "true" ,
344- } ,
345- body : JSON . stringify ( {
346- status : "RESTART_FLOW_ERROR" ,
347- } ) ,
348- } ) ;
349- }
350-
351- return request . continue ( ) ;
352- } ;
353- page . on ( "request" , requestHandler ) ;
354- try {
355- await tryEmailPasswordSignIn ( page , email ) ;
356-
357- await completeOTP ( page ) ;
358-
359- await waitForAccessDenied ( page ) ;
360- } finally {
361- page . off ( "request" , requestHandler ) ;
362- await page . setRequestInterception ( false ) ;
363- }
364- } ) ;
365-
366- it ( "should handle consumeCode restart flow error when setting up factor" , async ( ) => {
367- await setupST ( {
368- ...appConfig ,
369- mfaInfo : {
370- requirements : [ factorId ] ,
371- alreadySetup : [ ] ,
372- allowedToSetup : [ factorId ] ,
373- noContacts : true ,
374- } ,
375- } ) ;
376-
377- await page . setRequestInterception ( true ) ;
378- const requestHandler = ( request ) => {
379- if ( request . url ( ) === CONSUME_CODE_API && request . method ( ) === "POST" ) {
380- return request . respond ( {
381- status : 200 ,
382- headers : {
383- "access-control-allow-origin" : TEST_CLIENT_BASE_URL ,
384- "access-control-allow-credentials" : "true" ,
385- } ,
386- body : JSON . stringify ( {
387- status : "RESTART_FLOW_ERROR" ,
388- } ) ,
389- } ) ;
390- }
391-
392- return request . continue ( ) ;
393- } ;
394- page . on ( "request" , requestHandler ) ;
395- try {
396- await tryEmailPasswordSignIn ( page , email ) ;
397-
398- await setInputValues ( page , [
399- contactMethod === "PHONE"
400- ? { name : "phoneNumber_text" , value : getTestPhoneNumber ( ) }
401- : { name : "email" , value : await getTestEmail ( ) } ,
402- ] ) ;
403- await submitForm ( page ) ;
404-
405- await completeOTP ( page ) ;
406-
407- const error = await getGeneralError ( page ) ;
408- assert . strictEqual ( "Login unsuccessful. Please try again." , error ) ;
409- } finally {
410- page . off ( "request" , requestHandler ) ;
411- await page . setRequestInterception ( false ) ;
412- }
413- } ) ;
414-
415326 it ( "should enable you to change the contact info during setup (w/ contact form)" , async ( ) => {
416327 await setupST ( {
417328 ...appConfig ,
@@ -447,7 +358,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
447358 await completeOTP ( page ) ;
448359 } ) ;
449360
450- it ( "should show a link redirecting back if visited after sign in without stepUp param " , async ( ) => {
361+ it ( "should show a link redirecting back if visited after sign in - setup " , async ( ) => {
451362 await setupST ( {
452363 ...appConfig ,
453364 mfaInfo : {
@@ -456,37 +367,17 @@ describe("SuperTokens SignIn w/ MFA", function () {
456367 allowedToSetup : [ ] ,
457368 } ,
458369 } ) ;
459-
460370 await tryEmailPasswordSignIn ( page , email ) ;
461371
462372 await Promise . all ( [
463373 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth/mfa/${ factorId } ` ) ,
464374 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
465375 ] ) ;
466- await waitForDashboard ( page ) ;
467- } ) ;
468-
469- it ( "should show a link redirecting back if visited after sign in - force setup" , async ( ) => {
470- await setupST ( {
471- ...appConfig ,
472- mfaInfo : {
473- requirements : [ ] ,
474- alreadySetup : [ factorId ] ,
475- allowedToSetup : [ factorId ] ,
476- } ,
477- } ) ;
478-
479- await tryEmailPasswordSignIn ( page , email ) ;
480-
481- await Promise . all ( [
482- page . goto ( `${ TEST_CLIENT_BASE_URL } /auth/mfa/${ factorId } ?setup=true` ) ,
483- page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
484- ] ) ;
485376 const backBtn = await waitForSTElement ( page , "[data-supertokens~=backButton]" ) ;
486377 await backBtn . click ( ) ;
487378 await waitForDashboard ( page ) ;
488379 } ) ;
489- it ( "should show a link redirecting back if visited after sign in - setup in stepUp " , async ( ) => {
380+ it ( "should show a link redirecting back if visited after sign in - verification " , async ( ) => {
490381 await setupST ( {
491382 ...appConfig ,
492383 mfaInfo : {
@@ -499,28 +390,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
499390 await tryEmailPasswordSignIn ( page , email ) ;
500391
501392 await Promise . all ( [
502- page . goto ( `${ TEST_CLIENT_BASE_URL } /auth/mfa/${ factorId } ?stepUp=true` ) ,
503- page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
504- ] ) ;
505- const backBtn = await waitForSTElement ( page , "[data-supertokens~=backButton]" ) ;
506- await backBtn . click ( ) ;
507- await waitForDashboard ( page ) ;
508- } ) ;
509-
510- it ( "should show a link redirecting back if visited after sign in - verification in stepUp" , async ( ) => {
511- await setupST ( {
512- ...appConfig ,
513- mfaInfo : {
514- requirements : [ ] ,
515- alreadySetup : [ factorId ] ,
516- allowedToSetup : [ ] ,
517- } ,
518- } ) ;
519-
520- await tryEmailPasswordSignIn ( page , email ) ;
521-
522- await Promise . all ( [
523- page . goto ( `${ TEST_CLIENT_BASE_URL } /auth/mfa/${ factorId } ?stepUp=true` ) ,
393+ page . goto ( `${ TEST_CLIENT_BASE_URL } /auth/mfa/${ factorId } ` ) ,
524394 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
525395 ] ) ;
526396 const backBtn = await waitForSTElement ( page , "[data-supertokens~=backButton]" ) ;
0 commit comments