summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2021-04-15 21:34:26 -0700
committerMatthew Miller <matthew@millerti.me>2021-04-15 21:34:26 -0700
commitc8c492572a0f72c6d9b8795a4e37621b5f49d2b9 (patch)
tree204dddd53d07a64ea3f21ee855876dc9af4267be /packages/browser/src/methods/startAssertion.test.ts
parentcb445cd8404af140120260ca77294a70d7202a71 (diff)
Rename toUint8Array to stringToArrayBuffer
Diffstat (limited to 'packages/browser/src/methods/startAssertion.test.ts')
-rw-r--r--packages/browser/src/methods/startAssertion.test.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/browser/src/methods/startAssertion.test.ts b/packages/browser/src/methods/startAssertion.test.ts
index c077219..83c5a8b 100644
--- a/packages/browser/src/methods/startAssertion.test.ts
+++ b/packages/browser/src/methods/startAssertion.test.ts
@@ -6,7 +6,7 @@ import {
} from '@simplewebauthn/typescript-types';
import supportsWebauthn from '../helpers/supportsWebauthn';
-import toUint8Array from '../helpers/toUint8Array';
+import stringToArrayBuffer from '../helpers/stringToArrayBuffer';
import bufferToBase64URLString from '../helpers/bufferToBase64URLString';
import startAssertion from './startAssertion';
@@ -23,7 +23,7 @@ const mockUserHandle = 'mockUserHandle';
// With ASCII challenge
const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(toUint8Array('fizz')),
+ challenge: bufferToBase64URLString(stringToArrayBuffer('fizz')),
allowCredentials: [
{
id: 'C0VGlvYFratUdAV1iCw-ULpUW8E-exHPXQChBfyVeJZCMfjMFcwDmOFgoMUz39LoMtCJUBW8WPlLkGT6q8qTCg',
@@ -36,7 +36,7 @@ const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
// With UTF-8 challenge
const goodOpts2UTF8: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(toUint8Array('やれやれだぜ')),
+ challenge: bufferToBase64URLString(stringToArrayBuffer('やれやれだぜ')),
allowCredentials: [],
timeout: 1,
};
@@ -78,7 +78,7 @@ test('should convert options before passing to navigator.credentials.get(...)',
test('should support optional allowCredential', async () => {
await startAssertion({
- challenge: bufferToBase64URLString(toUint8Array('fizz')),
+ challenge: bufferToBase64URLString(stringToArrayBuffer('fizz')),
timeout: 1,
});
@@ -87,7 +87,7 @@ test('should support optional allowCredential', async () => {
test('should convert allow allowCredential to undefined when empty', async () => {
await startAssertion({
- challenge: bufferToBase64URLString(toUint8Array('fizz')),
+ challenge: bufferToBase64URLString(stringToArrayBuffer('fizz')),
timeout: 1,
allowCredentials: [],
});