summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2021-02-04 09:50:47 -0800
committerMatthew Miller <matthew@millerti.me>2021-02-04 09:50:47 -0800
commitfa377a92d9f30909e9a81b134253bd0798df8319 (patch)
tree19d03251802166c6b8c14a260e781445fbbf6953 /packages/browser/src/methods/startAssertion.test.ts
parent7aec8bf1b728f785ee13ffe50ba39d9e8787b3bd (diff)
Revert changes to Browser startAssertion tests
Diffstat (limited to 'packages/browser/src/methods/startAssertion.test.ts')
-rw-r--r--packages/browser/src/methods/startAssertion.test.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/browser/src/methods/startAssertion.test.ts b/packages/browser/src/methods/startAssertion.test.ts
index f763391..c74b88f 100644
--- a/packages/browser/src/methods/startAssertion.test.ts
+++ b/packages/browser/src/methods/startAssertion.test.ts
@@ -4,6 +4,7 @@ import {
} from '@simplewebauthn/typescript-types';
import supportsWebauthn from '../helpers/supportsWebauthn';
+import toUint8Array from '../helpers/toUint8Array';
import bufferToBase64URLString from '../helpers/bufferToBase64URLString';
import startAssertion from './startAssertion';
@@ -20,7 +21,7 @@ const mockUserHandle = 'mockUserHandle';
// With ASCII challenge
const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(Buffer.from('fizz', 'ascii')),
+ challenge: bufferToBase64URLString(toUint8Array('fizz')),
allowCredentials: [
{
id: 'C0VGlvYFratUdAV1iCw-ULpUW8E-exHPXQChBfyVeJZCMfjMFcwDmOFgoMUz39LoMtCJUBW8WPlLkGT6q8qTCg',
@@ -33,7 +34,7 @@ const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
// With UTF-8 challenge
const goodOpts2UTF8: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(Buffer.from('やれやれだぜ', 'utf-8')),
+ challenge: bufferToBase64URLString(toUint8Array('やれやれだぜ')),
allowCredentials: [],
timeout: 1,
};
@@ -87,7 +88,7 @@ test('should support optional allowCredential', async () => {
);
await startAssertion({
- challenge: bufferToBase64URLString(Buffer.from('fizz', 'ascii')),
+ challenge: bufferToBase64URLString(toUint8Array('fizz')),
timeout: 1,
});
@@ -110,7 +111,7 @@ test('should convert allow allowCredential to undefined when empty', async () =>
);
await startAssertion({
- challenge: bufferToBase64URLString(Buffer.from('fizz', 'ascii')),
+ challenge: bufferToBase64URLString(toUint8Array('fizz')),
timeout: 1,
allowCredentials: [],
});