Skip to content

Commit

Permalink
Fix sample test code (reactjs#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
numb86 authored and sophiebits committed Jan 7, 2020
1 parent 24ebabd commit 1e4159d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/docs/testing-recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,14 @@ it("changes value when clicked", () => {
// get ahold of the button element, and trigger some clicks on it
const button = document.querySelector("[data-testid=toggle]");
expect(button.innerHTML).toBe("Turn off");
expect(button.innerHTML).toBe("Turn on");
act(() => {
button.dispatchEvent(new MouseEvent("click", { bubbles: true }));
});
expect(onChange).toHaveBeenCalledTimes(1);
expect(button.innerHTML).toBe("Turn on");
expect(button.innerHTML).toBe("Turn off");
act(() => {
for (let i = 0; i < 5; i++) {
Expand Down

0 comments on commit 1e4159d

Please sign in to comment.