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/startAttestation.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/startAttestation.test.ts')
-rw-r--r-- | packages/browser/src/methods/startAttestation.test.ts | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/packages/browser/src/methods/startAttestation.test.ts b/packages/browser/src/methods/startAttestation.test.ts index a972014..ae79235 100644 --- a/packages/browser/src/methods/startAttestation.test.ts +++ b/packages/browser/src/methods/startAttestation.test.ts @@ -19,31 +19,29 @@ const mockAttestationObject = 'mockAtte'; const mockClientDataJSON = 'mockClie'; const goodOpts1: PublicKeyCredentialCreationOptionsJSON = { - publicKey: { - challenge: 'fizz', - attestation: 'direct', - pubKeyCredParams: [ - { - alg: -7, - type: 'public-key', - }, - ], - rp: { - id: '1234', - name: 'simplewebauthn', - }, - user: { - id: '5678', - displayName: 'username', - name: 'username', - }, - timeout: 1, - excludeCredentials: [{ - id: 'authIdentifier', + challenge: 'fizz', + attestation: 'direct', + pubKeyCredParams: [ + { + alg: -7, type: 'public-key', - transports: ['internal'], - }], + }, + ], + rp: { + id: '1234', + name: 'simplewebauthn', }, + user: { + id: '5678', + displayName: 'username', + name: 'username', + }, + timeout: 1, + excludeCredentials: [{ + id: 'authIdentifier', + type: 'public-key', + transports: ['internal'], + }], }; beforeEach(() => { @@ -67,8 +65,8 @@ test('should convert options before passing to navigator.credentials.create(...) const argsPublicKey = mockNavigatorCreate.mock.calls[0][0].publicKey; - expect(argsPublicKey.challenge).toEqual(toUint8Array(goodOpts1.publicKey.challenge)); - expect(argsPublicKey.user.id).toEqual(toUint8Array(goodOpts1.publicKey.user.id)); + expect(argsPublicKey.challenge).toEqual(toUint8Array(goodOpts1.challenge)); + expect(argsPublicKey.user.id).toEqual(toUint8Array(goodOpts1.user.id)); expect(argsPublicKey.excludeCredentials).toEqual([{ id: base64js.toByteArray('authIdentifier=='), type: 'public-key', |