diff options
author | Matthew Miller <matthew@millerti.me> | 2022-07-04 09:03:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 09:03:39 -0700 |
commit | e106570e8d09edcee927f1e2502c90b1a9d1ac40 (patch) | |
tree | 09dfc61765215ef9ff442e1cdae186f1f446ca14 /packages/browser/src/methods/startAuthentication.test.ts | |
parent | 184cbb4457285817db4ded722d7b54528988e2e0 (diff) | |
parent | 1a1322e27af3d68fa4cc98f62bf51c6c8e9f12ac (diff) |
Merge pull request #221 from MasterKale/feat/authenticator-attachment
feat/authenticator-attachment
Diffstat (limited to 'packages/browser/src/methods/startAuthentication.test.ts')
-rw-r--r-- | packages/browser/src/methods/startAuthentication.test.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index 6f1b87b..b246cb0 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -287,6 +287,23 @@ test('should throw error if no acceptable <input> is found', async () => { rejected.toThrow(/no <input>/i); }); +test('should return authenticatorAttachment if present', async () => { + // Mock extension return values from authenticator + mockNavigatorGet.mockImplementation((): Promise<any> => { + return new Promise(resolve => { + resolve({ + response: {}, + getClientExtensionResults: () => {}, + authenticatorAttachment: 'cross-platform', + }); + }); + }); + + const response = await startAuthentication(goodOpts1); + + expect(response.authenticatorAttachment).toEqual('cross-platform'); +}); + describe('WebAuthnError', () => { describe('AbortError', () => { const AbortError = generateCustomError('AbortError'); |