test(ActionBar): update test cases

This commit is contained in:
chenjiahan
2020-11-08 20:25:19 +08:00
parent 9c841da26d
commit cd9c36fe38
6 changed files with 104 additions and 119 deletions
+50
View File
@@ -0,0 +1,50 @@
import { mount } from '@vue/test-utils';
import ActionBarIcon from '..';
test('should render default slot and match snapshot', () => {
const wrapper = mount(ActionBarIcon, {
slots: {
default: 'Content',
},
});
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot and match snapshot', () => {
const wrapper = mount(ActionBarIcon, {
slots: {
default: 'Content',
icon: 'Custom Icon',
},
});
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot with badge and match snapshot', () => {
const wrapper = mount(ActionBarIcon, {
props: {
badge: '1',
},
slots: {
default: 'Content',
icon: 'Custom Icon',
},
});
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot with dot and match snapshot', () => {
const wrapper = mount(ActionBarIcon, {
props: {
dot: true,
},
slots: {
default: 'Content',
icon: 'Custom Icon',
},
});
expect(wrapper.html()).toMatchSnapshot();
});