diff --git a/src/icon/test/index.spec.js b/src/icon/test/index.spec.js index a609eac19..50bcac59e 100644 --- a/src/icon/test/index.spec.js +++ b/src/icon/test/index.spec.js @@ -67,7 +67,7 @@ test('should render badge correctly', () => { expect(wrapper.find('.van-badge').html()).toMatchSnapshot(); }); -test('should change icon size after using size prop', () => { +test('should change icon size when using size prop', () => { const wrapper = mount(Icon, { props: { size: 20, diff --git a/src/loading/test/__snapshots__/index.legacy.js.snap b/src/loading/test/__snapshots__/index.legacy.js.snap deleted file mode 100644 index 925bda61e..000000000 --- a/src/loading/test/__snapshots__/index.legacy.js.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`size prop 1`] = `
`; - -exports[`text-size prop 1`] = `
Text
`; diff --git a/src/loading/test/index.legacy.js b/src/loading/test/index.legacy.js deleted file mode 100644 index a68d5651c..000000000 --- a/src/loading/test/index.legacy.js +++ /dev/null @@ -1,25 +0,0 @@ -import { mount } from '@vue/test-utils'; -import Loading from '..'; - -test('size prop', () => { - const wrapper = mount(Loading, { - props: { - size: 20, - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); - -test('text-size prop', () => { - const wrapper = mount(Loading, { - props: { - textSize: 20, - }, - slots: { - default: () => 'Text', - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); diff --git a/src/loading/test/index.spec.js b/src/loading/test/index.spec.js new file mode 100644 index 000000000..05eecc41d --- /dev/null +++ b/src/loading/test/index.spec.js @@ -0,0 +1,29 @@ +import { mount } from '@vue/test-utils'; +import Loading from '..'; + +test('should change loading size when using size prop', () => { + const wrapper = mount(Loading, { + props: { + size: 20, + }, + }); + + const spinner = wrapper.find('.van-loading__spinner').element; + expect(spinner.style.width).toEqual('20px'); + expect(spinner.style.height).toEqual('20px'); +}); + +test('should change text font-size when using text-size prop', () => { + const wrapper = mount(Loading, { + props: { + textSize: 20, + }, + slots: { + default: () => 'Text', + }, + }); + + expect(wrapper.find('.van-loading__text').element.style.fontSize).toEqual( + '20px' + ); +});