MCPcopy Index your code
hub / github.com/TanStack/ai / expectClassChangesOnHover

Function expectClassChangesOnHover

testing/e2e/tests/devtools-helpers.ts:94–109  ·  view source on GitHub ↗
(
  hoverSource: Locator,
  highlightedTarget: Locator,
)

Source from the content-addressed store, hash-verified

92}
93
94export 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}

Calls 1

getAttributeMethod · 0.80

Tested by

no test coverage detected