summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods
diff options
context:
space:
mode:
Diffstat (limited to 'packages/browser/src/methods')
-rw-r--r--packages/browser/src/methods/startAuthentication.test.ts13
-rw-r--r--packages/browser/src/methods/startRegistration.test.ts15
2 files changed, 15 insertions, 13 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts
index e6ac9c7..31ace90 100644
--- a/packages/browser/src/methods/startAuthentication.test.ts
+++ b/packages/browser/src/methods/startAuthentication.test.ts
@@ -214,15 +214,16 @@ test('should support "cable" transport', async () => {
allowCredentials: [
{
...goodOpts1.allowCredentials![0],
- transports: ["cable"],
+ transports: ['cable'],
},
- ]
+ ],
};
await startAuthentication(opts);
- expect(mockNavigatorGet.mock.calls[0][0].publicKey.allowCredentials[0].transports[0])
- .toEqual("cable");
+ expect(mockNavigatorGet.mock.calls[0][0].publicKey.allowCredentials[0].transports[0]).toEqual(
+ 'cable',
+ );
});
test('should cancel an existing call when executed again', async () => {
@@ -242,9 +243,9 @@ test('should set up autofill a.k.a. Conditional UI', async () => {
allowCredentials: [
{
...goodOpts1.allowCredentials![0],
- transports: ["cable"],
+ transports: ['cable'],
},
- ]
+ ],
};
document.body.innerHTML = `
<form>
diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts
index 1ca9e62..381830e 100644
--- a/packages/browser/src/methods/startRegistration.test.ts
+++ b/packages/browser/src/methods/startRegistration.test.ts
@@ -106,7 +106,7 @@ test('should return base64url-encoded response values', async () => {
expect(response.response.clientDataJSON).toEqual('bW9ja0NsaWU');
});
-test('should throw error if WebAuthn isn\'t supported', async () => {
+test("should throw error if WebAuthn isn't supported", async () => {
mockSupportsWebauthn.mockReturnValue(false);
await expect(startRegistration(goodOpts1)).rejects.toThrow(
@@ -183,15 +183,16 @@ test('should support "cable" transport in excludeCredentials', async () => {
excludeCredentials: [
{
...goodOpts1.excludeCredentials![0],
- transports: ["cable"],
+ transports: ['cable'],
},
- ]
+ ],
};
await startRegistration(opts);
- expect(mockNavigatorCreate.mock.calls[0][0].publicKey.excludeCredentials[0].transports[0])
- .toEqual("cable");
+ expect(
+ mockNavigatorCreate.mock.calls[0][0].publicKey.excludeCredentials[0].transports[0],
+ ).toEqual('cable');
});
test('should return "cable" transport from response', async () => {
@@ -201,7 +202,7 @@ test('should return "cable" transport from response', async () => {
response: {
attestationObject: Buffer.from(mockAttestationObject, 'ascii'),
clientDataJSON: Buffer.from(mockClientDataJSON, 'ascii'),
- getTransports: () => (["cable"]),
+ getTransports: () => ['cable'],
},
getClientExtensionResults: () => ({}),
type: 'webauthn.create',
@@ -209,7 +210,7 @@ test('should return "cable" transport from response', async () => {
const response = await startRegistration(goodOpts1);
- expect(response.transports).toEqual(["cable"]);
+ expect(response.transports).toEqual(['cable']);
});
test('should cancel an existing call when executed again', async () => {