summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.test.ts
diff options
context:
space:
mode:
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 a17c160..f005a26 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 stringToArrayBuffer from '../helpers/stringToArrayBuffer';
+import utf8StringToBuffer from '../helpers/utf8StringToBuffer';
import bufferToBase64URLString from '../helpers/bufferToBase64URLString';
import startAssertion from './startAssertion';
@@ -23,7 +23,7 @@ const mockUserHandle = 'mockUserHandle';
// With ASCII challenge
const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(stringToArrayBuffer('fizz')),
+ challenge: bufferToBase64URLString(utf8StringToBuffer('fizz')),
allowCredentials: [
{
id: 'C0VGlvYFratUdAV1iCw-ULpUW8E-exHPXQChBfyVeJZCMfjMFcwDmOFgoMUz39LoMtCJUBW8WPlLkGT6q8qTCg',
@@ -36,7 +36,7 @@ const goodOpts1: PublicKeyCredentialRequestOptionsJSON = {
// With UTF-8 challenge
const goodOpts2UTF8: PublicKeyCredentialRequestOptionsJSON = {
- challenge: bufferToBase64URLString(stringToArrayBuffer('やれやれだぜ')),
+ challenge: bufferToBase64URLString(utf8StringToBuffer('やれやれだぜ')),
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(stringToArrayBuffer('fizz')),
+ challenge: bufferToBase64URLString(utf8StringToBuffer('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(stringToArrayBuffer('fizz')),
+ challenge: bufferToBase64URLString(utf8StringToBuffer('fizz')),
timeout: 1,
allowCredentials: [],
});