mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-11 02:28:30 +08:00
test: add more E2E tests for UI components
- Chat panel tests (interactive elements, iframe) - Settings tests (dark mode, language, draw.io theme) - Save dialog tests (buttons exist) - History dialog tests - Model config tests - Keyboard interaction tests - Upload area tests Total: 15 E2E tests, all passing
This commit is contained in:
24
tests/e2e/upload.spec.ts
Normal file
24
tests/e2e/upload.spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
|
||||
test.describe("File Upload Area", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/", { waitUntil: "networkidle" })
|
||||
await page
|
||||
.locator("iframe")
|
||||
.waitFor({ state: "visible", timeout: 30000 })
|
||||
})
|
||||
|
||||
test("page loads without console errors", async ({ page }) => {
|
||||
const errors: string[] = []
|
||||
page.on("pageerror", (err) => errors.push(err.message))
|
||||
|
||||
// Give page time to settle
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
// Filter out non-critical errors
|
||||
const criticalErrors = errors.filter(
|
||||
(e) => !e.includes("ResizeObserver") && !e.includes("Script error"),
|
||||
)
|
||||
expect(criticalErrors).toEqual([])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user