[new feauture] NoticeBar: add left-icon slot

This commit is contained in:
陈嘉涵
2019-04-30 14:48:10 +08:00
parent e00f43e595
commit 152ee6a90d
4 changed files with 36 additions and 8 deletions
@@ -0,0 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`left-icon slot 1`] = `
<div class="van-notice-bar">Custom Left Icon<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left: 0px; animation-delay: 1s; animation-duration: 0s;">
Content
</div>
</div>
</div>
`;
+16
View File
@@ -12,3 +12,19 @@ test('close event', () => {
close.trigger('click');
expect(wrapper.emitted('close')).toBeTruthy();
});
test('left-icon slot', () => {
const wrapper = mount({
template: `
<notice-bar>
Content
<template v-slot:left-icon>Custom Left Icon</template>
</notice-bar>
`,
components: {
NoticeBar
}
});
expect(wrapper).toMatchSnapshot();
});