fix: replace timeout with waitForState({ visible: true }) in userSelectView test

Replace page.waitForTimeout(500) with firstOption.waitFor({ state: 'visible' })
to properly wait for dropdown options to populate instead of using arbitrary timeout.

Addresses review feedback from christian-byrne.
This commit is contained in:
snomiao
2025-10-09 00:49:04 +00:00
parent 36126a5a75
commit e7e8c674b3

View File

@@ -41,11 +41,9 @@ test.describe('User Select View', () => {
const dropdownList = page.locator('.p-select-list')
await expect(dropdownList).toBeVisible()
// Wait for dropdown to populate
await page.waitForTimeout(500)
// Try to click first option if it exists
const firstOption = page.locator('.p-select-list .p-select-option').first()
await firstOption.waitFor({ state: 'visible' }).catch(() => {})
if ((await firstOption.count()) > 0) {
await firstOption.click()