diff --git a/__tests__/click.js b/__tests__/click.js index fb0c634c..1bd2cb46 100644 --- a/__tests__/click.js +++ b/__tests__/click.js @@ -221,4 +221,26 @@ describe("fireEvent.click", () => { userEvent.click(getByTestId("label")); expect(getByTestId("input")).toHaveProperty("checked", true); }); + + it("should submit a form when clicking on a + + ); + userEvent.click(getByText("Submit")); + expect(onSubmit).toHaveBeenCalledTimes(1); + }); + + it('should not submit a form when clicking on a + + ); + userEvent.click(getByText("Submit")); + expect(onSubmit).not.toHaveBeenCalled(); + }); });