fix(tests): ждать окончания анимации кнопок резервных копий

This commit is contained in:
Denozordec committed 2026-10-10 22:00:04 +07:00
1 parent 057b530364
commit 9da5e55367
8 files changed
+2508 -11

No files matched your search

+2 -1
View File
@@ -29,7 +29,8 @@ test("Backups1000: весь поиск, страница при refresh, отк
const scroll = page.locator('[data-slot="data-grid"] [data-slot="scroll-area-viewport"]'); await scroll.evaluate(el => { el.scrollLeft = el.scrollWidth })
for (const action of ["Скачать", "Восстановить", "Удалить"]) {
const button = rows.first().getByRole("button", { name: action + " config-1000.rsc", exact: true })
expect(await button.evaluate(el => { const box=el.getBoundingClientRect(), viewport=el.closest('[data-slot="scroll-area-viewport"]')!.getBoundingClientRect(), pinned=el.closest("tr")!.querySelector("td")!.getBoundingClientRect(); return box.width >= 44 && box.height >= 44 && box.left >= pinned.right-1 && box.right <= viewport.right+1 })).toBe(true)
// ReUI buttons animate from desktop icon size to their mobile touch target.
await expect.poll(() => button.evaluate(el => { const box=el.getBoundingClientRect(), viewport=el.closest('[data-slot="scroll-area-viewport"]')!.getBoundingClientRect(), pinned=el.closest("tr")!.querySelector("td")!.getBoundingClientRect(); return box.width >= 44 && box.height >= 44 && box.left >= pinned.right-1 && box.right <= viewport.right+1 })).toBe(true)
}
const restore = rows.first().getByRole("button", { name: "Восстановить config-1000.rsc", exact: true }); await restore.focus(); await page.keyboard.press("Enter"); await expect(page.getByRole("alertdialog")).toContainText("config-1000.rsc"); await page.getByRole("alertdialog").getByRole("button", { name: "Отмена", exact: true }).click(); await expect(restore).toBeFocused()
const remove = rows.first().getByRole("button", { name: "Удалить config-1000.rsc", exact: true })