mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-09 09:42:30 +08:00
Fixes based on Gemini and Codex review: - Remove brittle nth(1) selector in keyboard tests - Remove waitForTimeout(500) race condition - Remove if(isVisible) silent skip patterns - Add proper assertions instead of no-op checks - Remove expect(count >= 0) that always passes - Remove unused hasProviderUI variable All 14 E2E tests and 39 unit tests pass.
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import { expect, test } from "@playwright/test"
|
|
|
|
test.describe("Settings", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/", { waitUntil: "networkidle" })
|
|
await page
|
|
.locator("iframe")
|
|
.waitFor({ state: "visible", timeout: 30000 })
|
|
})
|
|
|
|
test("settings dialog opens", async ({ page }) => {
|
|
const settingsButton = page.locator(
|
|
'button[aria-label*="settings"], button:has(svg[class*="settings"])',
|
|
)
|
|
await expect(settingsButton).toBeVisible()
|
|
await settingsButton.click()
|
|
|
|
const dialog = page.locator('[role="dialog"]')
|
|
await expect(dialog).toBeVisible({ timeout: 5000 })
|
|
})
|
|
|
|
test("language selection is available", async ({ page }) => {
|
|
const settingsButton = page.locator(
|
|
'button[aria-label*="settings"], button:has(svg[class*="settings"])',
|
|
)
|
|
await settingsButton.click()
|
|
|
|
const dialog = page.locator('[role="dialog"]')
|
|
await expect(dialog).toBeVisible({ timeout: 5000 })
|
|
|
|
// Should have language selector showing English
|
|
await expect(dialog.locator('text="English"')).toBeVisible()
|
|
})
|
|
|
|
test("draw.io theme toggle exists", async ({ page }) => {
|
|
const settingsButton = page.locator(
|
|
'button[aria-label*="settings"], button:has(svg[class*="settings"])',
|
|
)
|
|
await settingsButton.click()
|
|
|
|
const dialog = page.locator('[role="dialog"]')
|
|
await expect(dialog).toBeVisible({ timeout: 5000 })
|
|
|
|
// Should have draw.io theme option (sketch or minimal)
|
|
const themeText = dialog.locator("text=/sketch|minimal/i")
|
|
await expect(themeText.first()).toBeVisible()
|
|
})
|
|
})
|