MessageBox: add distinguishCancelAndClose (#11831)

This commit is contained in:
杨奕
2018-07-03 12:02:21 +08:00
committed by hetech
parent b799d2ec4d
commit 5ef3d0ec8d
7 changed files with 239 additions and 24 deletions

View File

@@ -76,6 +76,24 @@ describe('MessageBox', () => {
}, 300);
});
it('distinguish cancel and close', done => {
let msgAction = '';
MessageBox({
title: '消息',
message: '这是一段内容',
distinguishCancelAndClose: true
}, action => {
msgAction = action;
});
setTimeout(() => {
document.querySelector('.el-message-box__close').click();
setTimeout(() => {
expect(msgAction).to.equal('close');
done();
}, 10);
}, 10);
});
it('alert', done => {
MessageBox.alert('这是一段内容', {
title: '标题名称',