Comments (4)
This could be fixed now with the addition of ESM as of 3.1.0
from preact-testing-library.
More evidence that this is an import problem: Wrapping fireEvent()
inside an act()
call causes the render to be flushed, if act()
is imported from preact/test-utils
:
import { act } from "preact/test-utils";
// ...
// This works as expected
act(() => fireEvent.click(button));
...but not if act()
is imported from Preact Testing Library:
import TLP from "@testing-library/preact";
const { act } = TLP;
// ...
// This does not work in Node.js 12
act(() => fireEvent.click(button));
from preact-testing-library.
Same problem. Any workaround?
from preact-testing-library.
Replacing fireEvent.change
to fireEvent.input
solved my problem
from preact-testing-library.
Related Issues (20)
- `eventWrapper` for dom-testing-library shouldn't be async
- state updates do not trigger render after rerender() call HOT 4
- Move release flow from travis to github actions HOT 1
- Feature: Support native ESM HOT 3
- The test stops when the function passed from the component is called in the fireEvent action handler
- queryByText where string starts/ends with space returns null HOT 2
- 🐛 onChange Event Misfiring HOT 3
- Stale DOM with fake timers in jest 27.x HOT 1
- A custom container does not get rendered inside baseElement HOT 1
- `global is not defined` from pretty-format (@testing-library/dom dependency update needed) HOT 1
- Add ESM support HOT 5
- touch events (onTouchEnter) do not work in jest jsdom HOT 3
- feat: add `renderHook` HOT 3
- Is this project dead? HOT 4
- `fireEvent` updates in 3.0.2 introduced a regression HOT 1
- Firing event by react-testing-library and handling it in onInput event HOT 1
- fireEvent.animationEnd does not call preact-registered listener HOT 1
- "SyntaxError: Cannot use import statement outside a module" running jest HOT 3
- Compatibility with preact v10.16 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preact-testing-library.