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:
dayuan.jiang
2026-01-04 19:58:48 +09:00
parent ca86c9ebc6
commit f415d457d8
4 changed files with 40 additions and 75 deletions

View File

@@ -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,
})
})
})