mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 08:00:34 +00:00
types: test cases typing
This commit is contained in:
29
src/progress/test/index.spec.ts
Normal file
29
src/progress/test/index.spec.ts
Normal 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');
|
||||
});
|
Reference in New Issue
Block a user