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
35 lines
1001 B
TypeScript
35 lines
1001 B
TypeScript
import {
|
|
expect,
|
|
getIframe,
|
|
getSettingsButton,
|
|
openSettings,
|
|
test,
|
|
} from "./lib/fixtures"
|
|
|
|
test.describe("Settings", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/", { waitUntil: "networkidle" })
|
|
await getIframe(page).waitFor({ state: "visible", timeout: 30000 })
|
|
})
|
|
|
|
test("settings dialog opens", async ({ page }) => {
|
|
await openSettings(page)
|
|
// openSettings already verifies dialog is visible
|
|
})
|
|
|
|
test("language selection is available", async ({ page }) => {
|
|
await openSettings(page)
|
|
|
|
const dialog = page.locator('[role="dialog"]')
|
|
await expect(dialog.locator('text="English"')).toBeVisible()
|
|
})
|
|
|
|
test("draw.io theme toggle exists", async ({ page }) => {
|
|
await openSettings(page)
|
|
|
|
const dialog = page.locator('[role="dialog"]')
|
|
const themeText = dialog.locator("text=/sketch|minimal/i")
|
|
await expect(themeText.first()).toBeVisible()
|
|
})
|
|
})
|