diff options
author | Matthew Miller <matthew@millerti.me> | 2020-05-26 22:38:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 22:38:27 -0700 |
commit | 5a1acc9128be6dbce3d8d718defe93fb14a88e36 (patch) | |
tree | 7eea60332475794ba7fa02ea24374fc98b59baf4 /packages/browser/src/methods/startAssertion.test.ts | |
parent | 2374c09f8444b8a80ce8429f2654ce1b3b92c346 (diff) | |
parent | 1c956b9c39f5c175d3841b1fafaeeb495d1eea6b (diff) |
Merge pull request #16 from MasterKale/feature/support-more-credential-options
feature/support-more-credential-options
Diffstat (limited to 'packages/browser/src/methods/startAssertion.test.ts')
-rw-r--r-- | packages/browser/src/methods/startAssertion.test.ts | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/packages/browser/src/methods/startAssertion.test.ts b/packages/browser/src/methods/startAssertion.test.ts index 7449dbf..db401dc 100644 --- a/packages/browser/src/methods/startAssertion.test.ts +++ b/packages/browser/src/methods/startAssertion.test.ts @@ -22,17 +22,15 @@ const mockSignature = toBase64String(toUint8Array('mockSignature')); const mockUserHandle = toBase64String(toUint8Array('mockUserHandle')); const goodOpts1: PublicKeyCredentialRequestOptionsJSON = { - publicKey: { - challenge: 'fizz', - allowCredentials: [ - { - id: 'abcdefgfdnsdfunguisdfgs', - type: 'public-key', - transports: ['nfc'], - }, - ], - timeout: 1, - }, + challenge: 'fizz', + allowCredentials: [ + { + id: 'abcdefgfdnsdfunguisdfgs', + type: 'public-key', + transports: ['nfc'], + }, + ], + timeout: 1, }; beforeEach(() => { @@ -57,7 +55,7 @@ test('should convert options before passing to navigator.credentials.get(...)', const argsPublicKey = mockNavigatorGet.mock.calls[0][0].publicKey; const credId = base64js.fromByteArray(argsPublicKey.allowCredentials[0].id); - expect(argsPublicKey.challenge).toEqual(toUint8Array(goodOpts1.publicKey.challenge)); + expect(argsPublicKey.challenge).toEqual(toUint8Array(goodOpts1.challenge)); // Make sure the credential ID is a proper base64 with a length that's a multiple of 4 expect(credId.length % 4).toEqual(0); |