-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw error if there is incorrect
relatesTo
in IDX response (#1421)
OKTA-612326 Throw error if there is incorrect `relatesTo` in IDX response
- Loading branch information
1 parent
933fff3
commit b3991a2
Showing
7 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { SelectAuthenticatorAuthenticate } from '../../../../lib/idx/remediators'; | ||
import { | ||
SelectAuthenticatorAuthenticateRemediationFactory, | ||
AuthenticatorValueFactory, | ||
PhoneAuthenticatorOptionFactory, | ||
} from '@okta/test.support/idx'; | ||
|
||
describe('remediators/Base/SelectAuthenticator', () => { | ||
describe('canRemediate', () => { | ||
it('retuns false if can\'t find matched authenticator by key', () => { | ||
const remediation = SelectAuthenticatorAuthenticateRemediationFactory.build({ | ||
value: [ | ||
AuthenticatorValueFactory.build({ | ||
options: [ | ||
PhoneAuthenticatorOptionFactory.params({ | ||
// prevent resolving of authenticator by `relatesTo` in purpose | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
_authenticator: 'cant_be_resolved' as any | ||
}).build(), | ||
] | ||
}) | ||
] | ||
}); | ||
|
||
const authenticators = [ | ||
{ id: 'foo' } | ||
]; | ||
const r = new SelectAuthenticatorAuthenticate(remediation, { authenticators }); | ||
expect(r.canRemediate()).toBe(false); | ||
}); | ||
}); | ||
}); |