Enzyme - How to access and set <input> value?

后端 未结 16 2144
面向向阳花
面向向阳花 2020-12-07 22:06

I\'m confused about how to access value when using mount. Here\'s what I\'ve got as my test:

  it(\'cancels changes w         


        
16条回答
  •  青春惊慌失措
    2020-12-07 22:24

    This worked for me:

    let wrapped = mount();
    expect(wrapped.find("input").get(0).props.value).toEqual("something");
    

提交回复
热议问题