模拟酶的安装中输入的更改不起作用?

时间:2019-07-24 09:50:37

标签: enzyme

test('meh', () => {
    const store = createStore(reducer);
    const wrapper = mount(
      <Provider store={store}>
        <MyComponent />
      </Provider>,
    );

    expect(wrapper.find('Button').prop('disabled')).toBe(true);

    const securityCodeInput = wrapper.find('input#securityCode');

    console.log('val 1 ', securityCodeInput.prop('value'));

    securityCodeInput.simulate('focus');
    securityCodeInput.simulate('change', { target: { value: '1234567' } });

    console.log('val 2 ', securityCodeInput.prop('value'));

0 个答案:

没有答案