diff options
author | Matthew Miller <matthew@millerti.me> | 2020-05-26 22:30:35 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-05-26 22:30:35 -0700 |
commit | 358e67309928ab515903cf36220bf3fb563778c0 (patch) | |
tree | 2b2a676be0ce2ee0fc3b6c14c338c2275686a875 /packages/browser/src/methods/startAssertion.test.ts | |
parent | 8b5f547e66230cafd01649d37a9870edb57a1e09 (diff) |
Update browser start methods to new types
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); |