diff --git a/tests/fallback.test.tsx b/tests/fallback.test.tsx index d6aefbd7..cd1d225d 100644 --- a/tests/fallback.test.tsx +++ b/tests/fallback.test.tsx @@ -60,10 +60,18 @@ describe('Fallback', () => { }); it('should change image, not error', () => { - const wrapper = mount(); + const wrapper = mount( + , + ); act(() => { + wrapper.find('.rc-image-img').simulate('error'); wrapper.setProps({ - src: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*NZuwQp_vcIQAAAAAAAAAAABkARQnAQ', + src: + 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*NZuwQp_vcIQAAAAAAAAAAABkARQnAQ', }); jest.runAllTimers(); wrapper.update(); @@ -72,5 +80,4 @@ describe('Fallback', () => { 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*NZuwQp_vcIQAAAAAAAAAAABkARQnAQ', ); }); - });