Files
vant/src/progress/test/index.spec.ts
T
neverlandandGitHub 1381070a12 chore: prefer named exports (#8315)
* chore: prefer named exports

* chore: fix import
2021-03-09 15:39:26 +08:00

30 lines
661 B
TypeScript

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');
});