Commit ef47d014 by Ari Rizzitano

tests

parent 2b95c799
......@@ -81,6 +81,21 @@ describe('asInput()', () => {
expect(wrapper.find('small').prop('id')).toEqual(`description-${testId}`);
});
it('overrides state value when props value changes', () => {
const initValue = 'foofoo';
const newValue = 'barbar';
const props = {
...baseProps,
value: initValue,
};
const wrapper = mount(<InputTestComponent {...props} />);
expect(wrapper.state('value')).toEqual(initValue);
wrapper.setProps({
value: newValue,
});
expect(wrapper.state('value')).toEqual(newValue);
});
describe('fires', () => {
it('blur handler', () => {
const spy = jest.fn();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment