mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-23 21:16:06 +00:00
test(app): restore e2e fixtures and flaky waits
This commit is contained in:
parent
fae97cc559
commit
9a87b785e6
1 changed files with 12 additions and 3 deletions
|
|
@ -88,10 +88,19 @@ test("changing theme persists in localStorage", async ({ page, gotoSession }) =>
|
|||
return document.documentElement.getAttribute("data-theme")
|
||||
})
|
||||
const currentTheme = (await select.locator('[data-slot="select-select-trigger-value"]').textContent())?.trim() ?? ""
|
||||
|
||||
await select.locator('[data-slot="select-select-trigger"]').click()
|
||||
|
||||
const trigger = select.locator('[data-slot="select-select-trigger"]')
|
||||
const items = page.locator('[data-slot="select-select-item"]')
|
||||
|
||||
await trigger.click()
|
||||
const open = await expect
|
||||
.poll(async () => (await items.count()) > 0, { timeout: 5_000 })
|
||||
.toBe(true)
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
if (!open) {
|
||||
await trigger.click()
|
||||
await expect.poll(async () => (await items.count()) > 0, { timeout: 10_000 }).toBe(true)
|
||||
}
|
||||
await expect(items.first()).toBeVisible()
|
||||
const count = await items.count()
|
||||
expect(count).toBeGreaterThan(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue