[improvement] NavBar: add test cases

This commit is contained in:
陈嘉涵
2019-05-31 10:03:25 +08:00
parent 84e71d59fa
commit 166afd1b04
3 changed files with 68 additions and 38 deletions
+23
View File
@@ -0,0 +1,23 @@
import NavBar from '..';
import { mount } from '../../../test/utils';
test('render left & right slot', () => {
const wrapper = mount(NavBar, {
scopedSlots: {
left: () => 'Custom Left',
right: () => 'Custom Right'
}
});
expect(wrapper).toMatchSnapshot();
});
test('render title slot', () => {
const wrapper = mount(NavBar, {
scopedSlots: {
title: () => 'Custom Title'
}
});
expect(wrapper).toMatchSnapshot();
});