@@ -19,7 +19,7 @@ describe('remediators/Base/SelectAuthenticator', () => {
1919 AuthenticatorValueFactory . build ( {
2020 options : [
2121 PhoneAuthenticatorOptionFactory . params ( {
22- // prevent resolving of authenticator by `relatesTo` in purpose
22+ // prevent resolving of authenticator by `relatesTo` on purpose
2323 // eslint-disable-next-line @typescript-eslint/no-explicit-any
2424 _authenticator : 'cant_be_resolved' as any
2525 } ) . build ( ) ,
@@ -39,7 +39,7 @@ describe('remediators/Base/SelectAuthenticator', () => {
3939
4040describe ( 'remediators/SelectAuthenticatorEnroll' , ( ) => {
4141 describe ( 'canRemediate' , ( ) => {
42- xit ( 'retuns false if matched authenticator is already the current one' , ( ) => {
42+ it ( 'retuns false if matched authenticator is already the current one' , ( ) => {
4343 const currentAuthenticator = EmailAuthenticatorFactory . build ( ) ;
4444 const remediation = SelectAuthenticatorEnrollRemediationFactory . build ( {
4545 value : [
@@ -69,7 +69,7 @@ describe('remediators/SelectAuthenticatorEnroll', () => {
6969
7070describe ( 'remediators/SelectAuthenticatorAuthenticate' , ( ) => {
7171 describe ( 'canRemediate' , ( ) => {
72- xit ( 'retuns false if matched authenticator is already the current one' , ( ) => {
72+ it ( 'retuns false if matched authenticator is already the current one' , ( ) => {
7373 const currentAuthenticatorEnrollment = PhoneAuthenticatorFactory . build ( ) ;
7474 const remediation = SelectAuthenticatorAuthenticateRemediationFactory . build ( {
7575 value : [
@@ -95,36 +95,29 @@ describe('remediators/SelectAuthenticatorAuthenticate', () => {
9595 expect ( r . canRemediate ( ) ) . toBe ( true ) ;
9696 } ) ;
9797
98- it ( 'returns true if matched authenticator has a resend form' , ( ) => {
99- const phoneAuthenticator = PhoneAuthenticatorFactory . build ( ) ;
98+ // Fix for OKTA-646147
99+ it ( 'retuns true if `options.step` is explicitly passed' , ( ) => {
100+ const currentAuthenticatorEnrollment = PhoneAuthenticatorFactory . build ( ) ;
100101 const remediation = SelectAuthenticatorAuthenticateRemediationFactory . build ( {
101102 value : [
102103 AuthenticatorValueFactory . build ( {
103104 options : [
104105 PhoneAuthenticatorOptionFactory . params ( {
105- _authenticator : phoneAuthenticator ,
106+ _authenticator : currentAuthenticatorEnrollment ,
106107 } ) . build ( ) ,
107108 ]
108109 } ) ,
109110 ]
110111 } ) ;
111112 const context = IdxContextFactory . build ( {
112113 currentAuthenticatorEnrollment : {
113- value : {
114- ...phoneAuthenticator ,
115- resend : ResendAuthenticatorFactory . build ( ) ,
116- }
117- } ,
118- authenticatorEnrollments : {
119- value : [ phoneAuthenticator ]
120- } ,
121- currentAuthenticator : { }
114+ value : currentAuthenticatorEnrollment
115+ }
122116 } ) ;
123-
124117 const authenticators = [
125- phoneAuthenticator ,
118+ currentAuthenticatorEnrollment ,
126119 ] ;
127- const r = new SelectAuthenticatorAuthenticate ( remediation , { authenticators } ) ;
120+ const r = new SelectAuthenticatorAuthenticate ( remediation , { authenticators } , { step : 'select-authenticator-authenticate' } ) ;
128121 expect ( r . canRemediate ( context ) ) . toBe ( true ) ;
129122 expect ( r . canRemediate ( ) ) . toBe ( true ) ;
130123 } ) ;
0 commit comments