mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
test(Badge): fix prop name
This commit is contained in:
parent
4154dc7404
commit
c9ff79390f
@ -6,8 +6,12 @@ exports[`should render content slot correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`should render nothing when badge is empty string 1`] = ``;
|
exports[`should render nothing when content is empty string 1`] = ``;
|
||||||
|
|
||||||
exports[`should render nothing when badge is undefined 1`] = ``;
|
exports[`should render nothing when content is undefined 1`] = ``;
|
||||||
|
|
||||||
exports[`should render nothing when badge is zero 1`] = ``;
|
exports[`should render nothing when content is zero 1`] = `
|
||||||
|
<div class="van-badge">
|
||||||
|
0
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
import Badge from '..';
|
import Badge from '..';
|
||||||
import { mount } from '@vue/test-utils';
|
import { mount } from '@vue/test-utils';
|
||||||
|
|
||||||
test('should render nothing when badge is empty string', () => {
|
test('should render nothing when content is empty string', () => {
|
||||||
const wrapper = mount(Badge, {
|
const wrapper = mount(Badge, {
|
||||||
props: {
|
props: {
|
||||||
badge: '',
|
content: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(wrapper.html()).toMatchSnapshot();
|
expect(wrapper.html()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should render nothing when badge is undefined', () => {
|
test('should render nothing when content is undefined', () => {
|
||||||
const wrapper = mount(Badge, {
|
const wrapper = mount(Badge, {
|
||||||
props: {
|
props: {
|
||||||
badge: undefined,
|
content: undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(wrapper.html()).toMatchSnapshot();
|
expect(wrapper.html()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should render nothing when badge is zero', () => {
|
test('should render nothing when content is zero', () => {
|
||||||
const wrapper = mount(Badge, {
|
const wrapper = mount(Badge, {
|
||||||
props: {
|
props: {
|
||||||
badge: 0,
|
content: 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user