Solid Testing Library

Guys , I have a function which has some signal and store updation inside it and I call this function by Clicking a button. Whenever I am doing userEvent click on the button my signal is not updating. I have to manually update the signal like below .
createRoot((dispose) => {
setSingal({ list: Array(5).fill(0)});
dispose();
});
userEvent.click(results.getByTestId("button-id"));
createRoot((dispose) => {
setSingal({ list: Array(5).fill(0)});
dispose();
});
userEvent.click(results.getByTestId("button-id"));
1 Reply
Alex Lohr
Alex Lohr2y ago
You need to await the userEvent. Also, to test async code, we have testEffect in our testing library as a simple way to test asynchronous reactivity.
Want results from more Discord servers?
Add your server