|
|
|
@ -80,8 +80,6 @@ describe('Radio', () => {
|
|
|
|
|
wrapper.vm.$refs.radioGroup.stateValue = 'B';
|
|
|
|
|
// wrapper.setData({ value: 'B' })
|
|
|
|
|
radios.at(0).trigger('change');
|
|
|
|
|
});
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
|
expect(onChange.mock.calls.length).toBe(1);
|
|
|
|
|
});
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
@ -91,8 +89,6 @@ describe('Radio', () => {
|
|
|
|
|
// controlled component
|
|
|
|
|
wrapper.setProps({ value: 'A' });
|
|
|
|
|
radios.at(1).trigger('change');
|
|
|
|
|
});
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
|
expect(onChange.mock.calls.length).toBe(2);
|
|
|
|
|
});
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
@ -135,9 +131,7 @@ describe('Radio', () => {
|
|
|
|
|
wrapper.vm.$refs.radioGroup.stateValue = 'B';
|
|
|
|
|
radios.at(0).trigger('change');
|
|
|
|
|
expect(onChange.mock.calls.length).toBe(1);
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
|
expect(onChangeRadioGroup.mock.calls.length).toBe(1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// controlled component
|
|
|
|
|
wrapper.setProps({ value: 'A' });
|
|
|
|
@ -159,13 +153,12 @@ describe('Radio', () => {
|
|
|
|
|
// uncontrolled component
|
|
|
|
|
wrapper.vm.$refs.radioGroup.stateValue = 'B';
|
|
|
|
|
radios.at(0).trigger('change');
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
|
expect(onChange.mock.calls.length).toBe(1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
asyncExpect(() => {
|
|
|
|
|
// controlled component
|
|
|
|
|
wrapper.setProps({ value: 'A' });
|
|
|
|
|
radios.at(1).trigger('change');
|
|
|
|
|
await asyncExpect(() => {
|
|
|
|
|
expect(onChange.mock.calls.length).toBe(2);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|