mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-10 10:12:31 +08:00
test: fix E2E test issues from review
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.
This commit is contained in:
@@ -29,7 +29,7 @@ test.describe("Smoke Tests", () => {
|
||||
})
|
||||
|
||||
test("settings dialog opens", async ({ page }) => {
|
||||
await page.goto("/")
|
||||
await page.goto("/", { waitUntil: "networkidle" })
|
||||
|
||||
// Wait for page to load
|
||||
await page
|
||||
@@ -38,14 +38,14 @@ test.describe("Smoke Tests", () => {
|
||||
|
||||
// Click settings button (gear icon)
|
||||
const settingsButton = page.locator(
|
||||
'button[aria-label*="settings"], button:has(svg[class*="lucide-settings"])',
|
||||
'button[aria-label*="settings"], button:has(svg[class*="settings"])',
|
||||
)
|
||||
if (await settingsButton.isVisible()) {
|
||||
await settingsButton.click()
|
||||
// Check if settings dialog appears
|
||||
await expect(page.locator('[role="dialog"]')).toBeVisible({
|
||||
timeout: 5000,
|
||||
})
|
||||
}
|
||||
await expect(settingsButton).toBeVisible()
|
||||
await settingsButton.click()
|
||||
|
||||
// Check if settings dialog appears
|
||||
await expect(page.locator('[role="dialog"]')).toBeVisible({
|
||||
timeout: 5000,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user