mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 23:25:18 +00:00
fix(e2e): agenda — waits de visibilidade para medir o slot do calendário (estabiliza inline/mais detalhes)
This commit is contained in:
parent
340407c758
commit
6c631bdeec
1 changed files with 13 additions and 8 deletions
|
|
@ -168,10 +168,14 @@ test.describe('Agenda — calendário operacional', () => {
|
|||
|
||||
const dayCell = page.getByRole('gridcell').nth(1)
|
||||
await dayCell.scrollIntoViewIfNeeded()
|
||||
const [slotBox, dayBox] = await Promise.all([
|
||||
page.locator('[data-time="14:00:00"]').last().boundingBox(),
|
||||
dayCell.boundingBox(),
|
||||
])
|
||||
// FullCalendar renders the time axis lazily and re-lays out on mount —
|
||||
// wait for both targets to be attached+visible before measuring, or the
|
||||
// bounding boxes race the grid render.
|
||||
const slotLocator = page.locator('[data-time="14:00:00"]:visible').last()
|
||||
await expect(slotLocator).toBeVisible()
|
||||
await expect(dayCell).toBeVisible()
|
||||
const slotBox = await slotLocator.boundingBox()
|
||||
const dayBox = await dayCell.boundingBox()
|
||||
if (!slotBox || !dayBox) throw new Error('A grade semanal não expôs o slot esperado.')
|
||||
await dayCell.click({
|
||||
position: {
|
||||
|
|
@ -216,10 +220,11 @@ test.describe('Agenda — calendário operacional', () => {
|
|||
|
||||
const dayCell = page.getByRole('gridcell').nth(1)
|
||||
await dayCell.scrollIntoViewIfNeeded()
|
||||
const [slotBox, dayBox] = await Promise.all([
|
||||
page.locator('[data-time="14:00:00"]').last().boundingBox(),
|
||||
dayCell.boundingBox(),
|
||||
])
|
||||
const slotLocator = page.locator('[data-time="14:00:00"]:visible').last()
|
||||
await expect(slotLocator).toBeVisible()
|
||||
await expect(dayCell).toBeVisible()
|
||||
const slotBox = await slotLocator.boundingBox()
|
||||
const dayBox = await dayCell.boundingBox()
|
||||
if (!slotBox || !dayBox) throw new Error('A grade semanal não expôs o slot esperado.')
|
||||
await dayCell.click({
|
||||
position: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue