diff --git a/src/progress/test/__snapshots__/index.legacy.js.snap b/src/progress/test/__snapshots__/index.legacy.js.snap deleted file mode 100644 index 47201dd08..000000000 --- a/src/progress/test/__snapshots__/index.legacy.js.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`calc width 1`] = `
`; - -exports[`calc width 2`] = `
test
`; diff --git a/src/progress/test/__snapshots__/index.spec.js.snap b/src/progress/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..fe02e3fdc --- /dev/null +++ b/src/progress/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should re-calc width if showing pivot dynamically 1`] = ` +
+ + +
+`; + +exports[`should re-calc width if showing pivot dynamically 2`] = ` +
+ + + test + + +
+`; diff --git a/src/progress/test/index.legacy.js b/src/progress/test/index.spec.js similarity index 58% rename from src/progress/test/index.legacy.js rename to src/progress/test/index.spec.js index 1e67e4626..c7e25e426 100644 --- a/src/progress/test/index.legacy.js +++ b/src/progress/test/index.spec.js @@ -1,25 +1,26 @@ import Progress from '..'; -import { mount, later } from '../../../test'; +import { mount } from '../../../test'; -test('calc width', async () => { +test('should re-calc width if showing pivot dynamically', async () => { const wrapper = mount(Progress, { props: { showPivot: false, percentage: 100, }, }); - await later(); expect(wrapper.html()).toMatchSnapshot(); - wrapper.vm.showPivot = true; - wrapper.vm.pivotText = 'test'; - await later(); + await wrapper.setProps({ + showPivot: true, + pivotText: 'test', + }); expect(wrapper.html()).toMatchSnapshot(); }); -test('track color prop', async () => { +test('should change track color when using track-color prop', () => { const wrapper = mount(Progress, { props: { + percentage: 0, trackColor: 'green', }, });