feat(NoticeBar): add replay event (#6079)

This commit is contained in:
neverland
2020-04-17 21:34:02 +08:00
committed by GitHub
parent 31674a162c
commit e95e09764a
4 changed files with 24 additions and 9 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
import NoticeBar from '..';
import { mount } from '../../../test';
import { mount, later } from '../../../test';
test('click event', () => {
const wrapper = mount(NoticeBar);
@@ -36,3 +36,15 @@ test('icon slot', () => {
expect(wrapper).toMatchSnapshot();
});
test('replay event', async () => {
const wrapper = mount(NoticeBar, {
propsData: {
text: 'foo',
},
});
wrapper.find('.van-notice-bar__content').trigger('animationend');
await later();
expect(wrapper.emitted('replay')).toBeTruthy();
});