( hoverSource: Locator, highlightedTarget: Locator, )
| 92 | } |
| 93 | |
| 94 | export async function expectClassChangesOnHover( |
| 95 | hoverSource: Locator, |
| 96 | highlightedTarget: Locator, |
| 97 | ) { |
| 98 | // Move the cursor outside the hook detail panes so any lingering |
| 99 | // mouseover from earlier actions (e.g. selectHook clicking a hook row) |
| 100 | // fires mouseleave and clears the hover-highlight state. Without this |
| 101 | // the "before" class can already include the highlighted variant. |
| 102 | await hoverSource.page().mouse.move(0, 0) |
| 103 | await hoverSource.page().waitForTimeout(50) |
| 104 | const before = await highlightedTarget.getAttribute('class') |
| 105 | await hoverSource.hover() |
| 106 | await expect |
| 107 | .poll(() => highlightedTarget.getAttribute('class')) |
| 108 | .not.toBe(before) |
| 109 | } |
no test coverage detected