[new feature] NoticeBar: add close event (#2692)

This commit is contained in:
neverland
2019-02-06 20:36:05 +08:00
committed by GitHub
parent 8fa872e52c
commit 9c5e5b8158
4 changed files with 22 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
import NoticeBar from '..';
import { mount } from '../../../test/utils';
test('close event', () => {
const wrapper = mount(NoticeBar, {
propsData: {
mode: 'closeable'
}
});
const close = wrapper.find('.van-notice-bar__right-icon');
close.trigger('click');
expect(wrapper.emitted('close')).toBeTruthy();
});