handle changes testing react

Solutions on MaxInterview for handle changes testing react by the best coders in the world

showing results for - "handle changes testing react"
Raphael
07 Apr 2018
1describe("handleChange", () => {
2  it("should call setState on title", () => {
3    const mockEvent = {
4      target: {
5        name: "title",
6        value: "test"
7      }
8    };
9    const expected = {
10      title: "test",
11      description: "",
12      submitActive: false
13    };
14    wrapper.instance().handleChange(mockEvent);
15    
16    expect(wrapper.state()).toEqual(expected);
17  });
18});
similar questions
queries leading to this page
handle changes testing react