Files
wehub-resource-sync e115934061
Publish `@librechat/data-schemas` to NPM / pack (push) Failing after 8s
Publish `@librechat/client` to NPM / pack (push) Failing after 0s
GitNexus Index / index (push) Failing after 1s
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been skipped
Sync Helm Chart Tags / Sync chart tags (push) Failing after 2s
Publish `librechat-data-provider` to NPM / pack (push) Failing after 1s
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Failing after 1s
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Failing after 0s
Sync Helm Chart Tags / Ignore non-main push (push) Has been skipped
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Failing after 1s
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
GitNexus Index / post-index (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:08:12 +08:00

43 lines
1.7 KiB
TypeScript

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 `<motion.div>`; 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([]);
});
});