diff options
-rw-r--r-- | packages/server/src/attestation/generateAttestationOptions.test.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/server/src/attestation/generateAttestationOptions.test.ts b/packages/server/src/attestation/generateAttestationOptions.test.ts index d3d49c7..dc67cf5 100644 --- a/packages/server/src/attestation/generateAttestationOptions.test.ts +++ b/packages/server/src/attestation/generateAttestationOptions.test.ts @@ -39,10 +39,30 @@ test('should generate credential request options suitable for sending via JSON', ], timeout, attestation: attestationType, + excludeCredentials: [], }, }); }); +test('should map excluded credential IDs if specified', () => { + const options = generateAttestationOptions( + 'WebAuthntine', + 'not.real', + 'totallyrandomvalue', + '1234', + 'usernameHere', + undefined, + undefined, + ['someIDhere'], + ); + + expect(options.publicKey.excludeCredentials).toEqual([{ + id: 'someIDhere', + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + }]); +}); + test('defaults to 60 seconds if no timeout is specified', () => { const options = generateAttestationOptions( 'WebAuthntine', |