From 61cf1a9714806869d9592c697a778847cda5ca8e Mon Sep 17 00:00:00 2001 From: Evan Sharp Date: Wed, 28 Sep 2016 17:36:24 -0400 Subject: [PATCH] tests(RadioGroup): test for value prop change --- __test__/AvRadioGroup.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/__test__/AvRadioGroup.spec.js b/__test__/AvRadioGroup.spec.js index 6ebf5c4..8b14555 100644 --- a/__test__/AvRadioGroup.spec.js +++ b/__test__/AvRadioGroup.spec.js @@ -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(, 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(, options); const component = wrapper.instance();