feat: toast update

This commit is contained in:
jiangruowei
2017-03-22 16:53:57 +08:00
parent 7fb9a274de
commit 6728837bb2
5 changed files with 160 additions and 26 deletions

View File

@@ -0,0 +1,36 @@
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);
});
});