import React from 'react'; import { mount } from 'enzyme'; import Progress from '..'; describe('Progress', () => { it('successPercent should decide the progress status when it exists', () => { const wrapper = mount(); expect(wrapper.find('.ant-progress-status-success')).toHaveLength(0); wrapper.setProps({ percent: 50, successPercent: 100 }); expect(wrapper.find('.ant-progress-status-success')).toHaveLength(1); wrapper.setProps({ percent: 100, successPercent: 0 }); expect(wrapper.find('.ant-progress-status-success')).toHaveLength(0); }); it('render out-of-range progress', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('render out-of-range progress with info', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('render negetive progress', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('render negetive successPercent', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('render format', () => { const wrapper = mount( `${percent} ${successPercent}`} />, ); expect(wrapper.render()).toMatchSnapshot(); }); it('render strokeColor', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('render normal progress', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); });