feat(NoticeBar): add replay event (#6079)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user