From 3b05d8aa38cab99cdb22bb6b8af90a932ee8a0e1 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 25 Aug 2025 11:08:21 +0200 Subject: [PATCH 1/2] test(passkey): fix the usage of `WebAuthn.enable` --- tests/e2e/passkey.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/passkey.test.ts b/tests/e2e/passkey.test.ts index 9b221bf1f..3806213c4 100644 --- a/tests/e2e/passkey.test.ts +++ b/tests/e2e/passkey.test.ts @@ -1,10 +1,11 @@ import { faker } from '@faker-js/faker' +import { type Page } from '@playwright/test' import { expect, test } from '#tests/playwright-utils.ts' -async function setupWebAuthn(page: any) { +async function setupWebAuthn(page: Page) { const client = await page.context().newCDPSession(page) // https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn/ - await client.send('WebAuthn.enable', { options: { enableUI: true } }) + await client.send('WebAuthn.enable', { enableUI: true }) const result = await client.send('WebAuthn.addVirtualAuthenticator', { options: { protocol: 'ctap2', From e3a115f261dad379c9c9aeadff70e8b6df291549 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 25 Aug 2025 11:14:58 +0200 Subject: [PATCH 2/2] chore: fix incorrect array index access in tests --- tests/e2e/passkey.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/passkey.test.ts b/tests/e2e/passkey.test.ts index 3806213c4..7c2e11334 100644 --- a/tests/e2e/passkey.test.ts +++ b/tests/e2e/passkey.test.ts @@ -60,7 +60,7 @@ test('Users can register and use passkeys', async ({ page, login }) => { // Try logging in with passkey await page.goto('/login') - const signCount1 = afterRegistrationCredentials.credentials[0].signCount + const signCount1 = afterRegistrationCredentials.credentials[0]!.signCount const passkeyAssertedPromise = new Promise((resolve) => { client.once('WebAuthn.credentialAsserted', () => resolve()) @@ -86,7 +86,7 @@ test('Users can register and use passkeys', async ({ page, login }) => { authenticatorId, }) expect(afterLoginCredentials.credentials).toHaveLength(1) - expect(afterLoginCredentials.credentials[0].signCount).toBeGreaterThan( + expect(afterLoginCredentials.credentials[0]?.signCount).toBeGreaterThan( signCount1, )