mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
37 lines
812 B
JavaScript
37 lines
812 B
JavaScript
import Toast from 'packages/toast';
|
|
import { mount } from 'avoriaz';
|
|
|
|
describe('Toast', () => {
|
|
it('create simple toast', () => {
|
|
Toast('a message');
|
|
var toast = document.querySelector('.zan-toast');
|
|
|
|
expect(toast).not.to.be.underfined;
|
|
|
|
setTimeout(() => {
|
|
expect(toast.hidden).to.be.true;
|
|
}, 301);
|
|
});
|
|
|
|
it('create loading toast', () => {
|
|
Toast.loading('');
|
|
var toast = document.querySelector('.zan-toast');
|
|
|
|
expect(toast).not.to.be.underfined;
|
|
|
|
setTimeout(() => {
|
|
expect(toast.hidden).to.be.true;
|
|
}, 301);
|
|
});
|
|
it('create loading toast', () => {
|
|
Toast.success('');
|
|
var toast = document.querySelector('.zan-toast');
|
|
|
|
expect(toast).not.to.be.underfined;
|
|
|
|
setTimeout(() => {
|
|
expect(toast.hidden).to.be.true;
|
|
}, 301);
|
|
});
|
|
});
|