Skip to content

Commit

Permalink
tests(RadioGroup): test for value prop change
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSharpieOne committed Sep 28, 2016
1 parent 8b75826 commit 61cf1a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __test__/AvRadioGroup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ describe('AvRadioGroup', () => {
expect(component.getDefaultValue()).to.eql({key: 'defaultValue', value: 'momo'});
});

it('should update the value when the value prop changes', () => {
const wrapper = shallow(<AvRadioGroup name="yo" defaultValue="momo" />, options);
const component = wrapper.instance();
expect(component.getValue()).to.equal('momo');
wrapper.setProps({value: 'yoyo'});
expect(component.getValue()).to.equal('yoyo');
});

it('should give default value from context', () => {
const wrapper = shallow(<AvRadioGroup name="yo" />, options);
const component = wrapper.instance();
Expand Down

0 comments on commit 61cf1a9

Please sign in to comment.