mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
[new feature] Dialog: support component call (#593)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import Vue from 'vue';
|
||||
import Dialog from 'packages/dialog';
|
||||
|
||||
describe('Dialog', () => {
|
||||
@@ -49,4 +50,18 @@ describe('Dialog', () => {
|
||||
document.querySelector('.van-dialog__cancel').click();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
it('set default options', () => {
|
||||
Dialog.setDefaultOptions({
|
||||
title: 'default title'
|
||||
});
|
||||
expect(Dialog.currentOptions.title).to.equal('default title');
|
||||
Dialog.resetDefaultOptions();
|
||||
expect(Dialog.currentOptions.title).to.equal('');
|
||||
});
|
||||
|
||||
it('register dialog component', () => {
|
||||
Vue.use(Dialog);
|
||||
expect(!!Vue.component('van-dialog')).to.be.true;
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user