Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rburgst/preact-testing-lib-pointer-events-bug

shows a problem with pointer events and preact-testing-library
https://github.com/rburgst/preact-testing-lib-pointer-events-bug

Last synced: 2 days ago
JSON representation

shows a problem with pointer events and preact-testing-library

Awesome Lists containing this project

README

        

Sample repo that shows a problem where `fireEvent.pointerEnter` does not work for a preact component.

To reproduce

```
yarn install
yarn test
```

The following does not work

```typescript
interface TestComponentProps {
onPointerEnter: () => void
onClick: () => void
}
export const TestComponent : FunctionComponent = ({onPointerEnter, onClick}) => {
return

My Div

}
```

and the corresponding test
```typescript

interface TestComponentProps {
onPointerEnter: () => void
onClick: () => void
}
export const TestComponent : FunctionComponent = ({onPointerEnter, onClick}) => {
return

My Div

}
```

The problem appears that the listeners in jsdom are registered with `PointerEnter` while the event being fired is `pointerenter`.

Screenshot of the listeners in jsdoms `EventTarget-impl.js` `invokeEventListeners`
![img.png](doc/img.png)