types: test cases typing

This commit is contained in:
chenjiahan
2021-02-11 13:04:00 +08:00
parent 7a5fb894d2
commit e2e0f66fe6
87 changed files with 129 additions and 121 deletions

View File

@@ -0,0 +1,29 @@
import Progress from '..';
import { mount } from '../../../test';
test('should re-calc width if showing pivot dynamically', async () => {
const wrapper = mount(Progress, {
props: {
showPivot: false,
percentage: 100,
},
});
expect(wrapper.html()).toMatchSnapshot();
await wrapper.setProps({
showPivot: true,
pivotText: 'test',
});
expect(wrapper.html()).toMatchSnapshot();
});
test('should change track color when using track-color prop', () => {
const wrapper = mount(Progress, {
props: {
percentage: 0,
trackColor: 'green',
},
});
expect(wrapper.style.background).toEqual('green');
});