Skip to content

Commit 64767ad

Browse files
authored
docs: fix fireEvent Example code (#1019)
1 parent e995517 commit 64767ad

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/preact-testing-library/api.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@ fireEvent.click(buttonNode);
113113

114114
// Fire event Option 2.
115115
fireEvent(
116-
buttonNode,
117-
new Event('MouseEvent', {
118-
bubbles: true,
119-
cancelable: true,
120-
button: 0,
121-
});
116+
buttonNode,
117+
new MouseEvent('click', {
118+
bubbles: true,
119+
cancelable: true,
120+
button: 0,
121+
})
122+
);
122123

123124
expect(buttonNode).toHaveTextContent('1');
124125
expect(cb).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)