summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/browser/src')
-rw-r--r--packages/browser/src/methods/startAuthentication.test.ts17
-rw-r--r--packages/browser/src/methods/startRegistration.test.ts17
2 files changed, 34 insertions, 0 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts
index 725cd4e..658b67c 100644
--- a/packages/browser/src/methods/startAuthentication.test.ts
+++ b/packages/browser/src/methods/startAuthentication.test.ts
@@ -202,6 +202,23 @@ test('should include extension results when no extensions specified', async () =
expect(response.clientExtensionResults).toEqual({});
});
+test('should support "cable" transport', async () => {
+ const opts: PublicKeyCredentialRequestOptionsJSON = {
+ ...goodOpts1,
+ allowCredentials: [
+ {
+ ...goodOpts1.allowCredentials![0],
+ transports: ["cable"],
+ },
+ ]
+ };
+
+ await startAuthentication(opts);
+
+ expect(mockNavigatorGet.mock.calls[0][0].publicKey.allowCredentials[0].transports[0])
+ .toEqual("cable");
+});
+
describe('WebAuthnError', () => {
describe('AbortError', () => {
const AbortError = generateCustomError('AbortError');
diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts
index 360884e..d8d34aa 100644
--- a/packages/browser/src/methods/startRegistration.test.ts
+++ b/packages/browser/src/methods/startRegistration.test.ts
@@ -176,6 +176,23 @@ test('should include extension results when no extensions specified', async () =
expect(response.clientExtensionResults).toEqual({});
});
+test('should support "cable" transport', async () => {
+ const opts: PublicKeyCredentialCreationOptionsJSON = {
+ ...goodOpts1,
+ excludeCredentials: [
+ {
+ ...goodOpts1.excludeCredentials![0],
+ transports: ["cable"],
+ },
+ ]
+ };
+
+ await startRegistration(opts);
+
+ expect(mockNavigatorCreate.mock.calls[0][0].publicKey.excludeCredentials[0].transports[0])
+ .toEqual("cable");
+});
+
describe('WebAuthnError', () => {
describe('AbortError', () => {
const AbortError = generateCustomError('AbortError');