From f86e3ae41824269964041f19efe09bf526f00aca Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 4 Jun 2026 13:25:02 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20Add=20E2E=20Regression?= =?UTF-8?q?=20For=202FA=20framer-motion=20Crash=20(#13513)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Playwright mock e2e spec that opens Settings -> Account -> Enable 2FA and asserts the framer-motion dialog renders. Reproduces the Vite / framer-motion incompatibility from issue #13511: on the current build the dialog crashes the client with "e is not a function" and never renders, so this spec fails until the framer-motion bump in #13512 is merged. --- e2e/specs/mock/two-factor.spec.ts | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 e2e/specs/mock/two-factor.spec.ts diff --git a/e2e/specs/mock/two-factor.spec.ts b/e2e/specs/mock/two-factor.spec.ts new file mode 100644 index 0000000000..d1f3245179 --- /dev/null +++ b/e2e/specs/mock/two-factor.spec.ts @@ -0,0 +1,42 @@ +import { expect, test } from '@playwright/test'; +import { NEW_CHAT_PATH } from './helpers'; + +/** + * Regression test for the framer-motion / Vite incompatibility that crashed the + * client with "e is not a function" when opening the Enable 2FA dialog + * (issue #13511). The dialog body is a framer-motion ``; on the + * broken build it throws while rendering, so the dialog never appears. + * + * This only reproduces in a production build (the mock harness builds the client + * via `e2e:prepare`), matching the original report. + */ +test.describe('account settings · two-factor dialog', () => { + test('opening the Enable 2FA dialog renders without a framer-motion crash', async ({ page }) => { + test.setTimeout(60000); + + const framerErrors: string[] = []; + page.on('pageerror', (error) => { + if (/is not a function/i.test(error.message)) { + framerErrors.push(error.message); + } + }); + + await page.goto(NEW_CHAT_PATH, { timeout: 10000 }); + + await page.getByTestId('nav-user').click(); + await page.getByRole('menuitem', { name: 'Settings' }).click(); + await page.getByRole('tab', { name: 'Account' }).click(); + + // Opening the dialog mounts the framer-motion-animated body — the crash site. + await page.getByRole('button', { name: 'Enable 2FA' }).click(); + + // With the broken framer-motion build this content never renders. + await expect(page.locator('#two-factor-authentication-dialog')).toBeVisible({ timeout: 15000 }); + await expect(page.getByRole('button', { name: 'Generate QR Code' })).toBeVisible(); + + expect( + framerErrors, + `framer-motion threw while rendering the 2FA dialog: ${framerErrors.join(' | ')}`, + ).toEqual([]); + }); +});