MCPcopy Create free account
hub / github.com/testing-library/user-event / assertPointerEvents

Function assertPointerEvents

src/utils/pointer/cssPointerEvents.ts:81–95  ·  view source on GitHub ↗
(instance: Instance, element: Element)

Source from the content-addressed store, hash-verified

79}
80
81export function assertPointerEvents(instance: Instance, element: Element) {
82 const declaration = checkPointerEvents(instance, element)
83
84 if (declaration?.pointerEvents === 'none') {
85 throw new Error(
86 [
87 `Unable to perform pointer interaction as the element ${
88 declaration.tree.length > 1 ? 'inherits' : 'has'
89 } \`pointer-events: none\`:`,
90 '',
91 printTree(declaration.tree),
92 ].join('\n'),
93 )
94 }
95}
96
97function printTree(tree: Element[]) {
98 return tree

Callers 6

initMethod · 0.90
moveMethod · 0.90
downMethod · 0.90
upMethod · 0.90
unhoverFunction · 0.90

Calls 2

checkPointerEventsFunction · 0.85
printTreeFunction · 0.85

Tested by

no test coverage detected