mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Retry UI test assertions (#14165)
We noticed that some of the tests depending on the `hover:` variant were flaky. After some investigation, we found that injected elements had the `:hover` state without us explicitly hovering over the element. To avoid this, we now set up an explicit placeholder element to move the mouse to before running the tests.
This commit is contained in:
parent
fbf877aa0a
commit
8cace0d9b5
@ -305,6 +305,14 @@ async function render(page: Page, content: string) {
|
||||
}
|
||||
`)
|
||||
|
||||
// We noticed that some of the tests depending on the `hover:` variant were
|
||||
// flaky. After some investigation, we found that injected elements had the
|
||||
// `:hover` state without us explicitly hovering over the element.
|
||||
//
|
||||
// To avoid this, we now set up an explicit placeholder element to move the
|
||||
// mouse to before running the tests.
|
||||
content = `<div id="mouse-park" class="size-12"></div>${content}`
|
||||
|
||||
await page.setContent(content)
|
||||
await page.addStyleTag({
|
||||
content: optimizeCss(
|
||||
@ -312,6 +320,8 @@ async function render(page: Page, content: string) {
|
||||
),
|
||||
})
|
||||
|
||||
await page.locator('#mouse-park').hover()
|
||||
|
||||
return {
|
||||
getPropertyValue(selector: string | [string, string], property: string) {
|
||||
return getPropertyValue(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user