Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rburgst/preact-testing-lib-pointer-events-bug
- Owner: rburgst
- Created: 2022-04-04T10:24:28.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-04T10:24:51.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T17:53:06.309Z (about 2 months ago)
- Language: TypeScript
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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}) => {
returnMy Div
}
```and the corresponding test
```typescriptinterface TestComponentProps {
onPointerEnter: () => void
onClick: () => void
}
export const TestComponent : FunctionComponent = ({onPointerEnter, onClick}) => {
returnMy 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)