diff --git a/tests/Browser/ContainmentTest.php b/tests/Browser/ContainmentTest.php index afaec5cd..903bd08d 100644 --- a/tests/Browser/ContainmentTest.php +++ b/tests/Browser/ContainmentTest.php @@ -522,11 +522,18 @@ it('gives a closing standard side sheet\'s room back to the content beside it as // Closed and sampled in one round trip: the sheet's root caught part-way between its width // and none, still in the layout, while the column beside it has grown part of the way — not - // the whole sheet and its gap handed back in one jump at the end. + // the whole sheet and its gap handed back in one jump at the end. Only once the view has + // settled, two frames after Alpine starts, which WebKit can still be waiting for here: until + // then the sheet has no transitions, on purpose, and closes at once. $midExit = $page->script(<< { const root = {$root} const column = {$column} + + for (let i = 0; i < 100 && ! root.hasAttribute('data-md-drawer-settled'); i++) { + await new Promise((resolve) => setTimeout(resolve, 10)) + } + const open = { root: root.getBoundingClientRect().width, column: column.getBoundingClientRect().width, row: root.parentElement.getBoundingClientRect().width } {$toggle}.click()