@@ -19,7 +19,7 @@ describe('remediators/Base/SelectAuthenticator', () => {
19
19
AuthenticatorValueFactory . build ( {
20
20
options : [
21
21
PhoneAuthenticatorOptionFactory . params ( {
22
- // prevent resolving of authenticator by `relatesTo` in purpose
22
+ // prevent resolving of authenticator by `relatesTo` on purpose
23
23
// eslint-disable-next-line @typescript-eslint/no-explicit-any
24
24
_authenticator : 'cant_be_resolved' as any
25
25
} ) . build ( ) ,
@@ -39,7 +39,7 @@ describe('remediators/Base/SelectAuthenticator', () => {
39
39
40
40
describe ( 'remediators/SelectAuthenticatorEnroll' , ( ) => {
41
41
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' , ( ) => {
43
43
const currentAuthenticator = EmailAuthenticatorFactory . build ( ) ;
44
44
const remediation = SelectAuthenticatorEnrollRemediationFactory . build ( {
45
45
value : [
@@ -69,7 +69,7 @@ describe('remediators/SelectAuthenticatorEnroll', () => {
69
69
70
70
describe ( 'remediators/SelectAuthenticatorAuthenticate' , ( ) => {
71
71
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' , ( ) => {
73
73
const currentAuthenticatorEnrollment = PhoneAuthenticatorFactory . build ( ) ;
74
74
const remediation = SelectAuthenticatorAuthenticateRemediationFactory . build ( {
75
75
value : [
@@ -95,36 +95,29 @@ describe('remediators/SelectAuthenticatorAuthenticate', () => {
95
95
expect ( r . canRemediate ( ) ) . toBe ( true ) ;
96
96
} ) ;
97
97
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 ( ) ;
100
101
const remediation = SelectAuthenticatorAuthenticateRemediationFactory . build ( {
101
102
value : [
102
103
AuthenticatorValueFactory . build ( {
103
104
options : [
104
105
PhoneAuthenticatorOptionFactory . params ( {
105
- _authenticator : phoneAuthenticator ,
106
+ _authenticator : currentAuthenticatorEnrollment ,
106
107
} ) . build ( ) ,
107
108
]
108
109
} ) ,
109
110
]
110
111
} ) ;
111
112
const context = IdxContextFactory . build ( {
112
113
currentAuthenticatorEnrollment : {
113
- value : {
114
- ...phoneAuthenticator ,
115
- resend : ResendAuthenticatorFactory . build ( ) ,
116
- }
117
- } ,
118
- authenticatorEnrollments : {
119
- value : [ phoneAuthenticator ]
120
- } ,
121
- currentAuthenticator : { }
114
+ value : currentAuthenticatorEnrollment
115
+ }
122
116
} ) ;
123
-
124
117
const authenticators = [
125
- phoneAuthenticator ,
118
+ currentAuthenticatorEnrollment ,
126
119
] ;
127
- const r = new SelectAuthenticatorAuthenticate ( remediation , { authenticators } ) ;
120
+ const r = new SelectAuthenticatorAuthenticate ( remediation , { authenticators } , { step : 'select-authenticator-authenticate' } ) ;
128
121
expect ( r . canRemediate ( context ) ) . toBe ( true ) ;
129
122
expect ( r . canRemediate ( ) ) . toBe ( true ) ;
130
123
} ) ;
0 commit comments