'How to disable @testing-library/react unknown event handler
I am creating a next.js app and using jest for doing testing. When i create a test, i encounter this error: Warning: Unknown event handler property onChangeText. It will be ignored.
This is because i create a custom component with a property onChangeText which is a shortcut of onChange that just take the text value right away. But when i run the jest testing, i encounter the error Warning: Unknown event handler property onChangeText` but i dont get the error in the browser console.
How to disable it or surpress the error log here?
import { render, screen } from "@testing-library/react";
import AddCompany from "./AddCompany";
import "@testing-library/jest-dom";
import { Providers } from "config/Providers";
describe("AddCompany", () => {
it("renders a add company form", () => {
render(
<Providers>
<AddCompany />
</Providers>
);
expect(screen.queryByText("Company name")).toBeDefined();
});
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
