mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-07 00:32:28 +08:00
- Add tests/e2e/lib/fixtures.ts with shared test helpers - Add tests/e2e/fixtures/diagrams.ts with XML test data - Add expectBeforeAndAfterReload() helper for persistence tests - Add test.step() for better test reporting in complex tests - Consolidate mock helpers into fixtures module - Reduce code duplication across 17 test files
21 lines
685 B
TypeScript
21 lines
685 B
TypeScript
import { expect, getIframe, test } from "./lib/fixtures"
|
|
|
|
test.describe("File Upload Area", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/", { waitUntil: "networkidle" })
|
|
await getIframe(page).waitFor({ state: "visible", timeout: 30000 })
|
|
})
|
|
|
|
test("page loads without console errors", async ({ page }) => {
|
|
const errors: string[] = []
|
|
page.on("pageerror", (err) => errors.push(err.message))
|
|
|
|
await page.waitForTimeout(1000)
|
|
|
|
const criticalErrors = errors.filter(
|
|
(e) => !e.includes("ResizeObserver") && !e.includes("Script error"),
|
|
)
|
|
expect(criticalErrors).toEqual([])
|
|
})
|
|
})
|