Skip to content

Commit

Permalink
fix(Dialog): quick-calling support set prefix to dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lianmin committed Oct 10, 2019
1 parent a93fc2d commit 7d458d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dialog/show.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class Modal extends Component {

return (
<Dialog
prefix={prefix}
role="alertdialog"
{...others}
visible={visible}
Expand Down
14 changes: 14 additions & 0 deletions test/dialog/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,20 @@ describe('inner', () => {
assert(!document.querySelector('.far-overlay-wrapper'));
});

it('quick-calling should should support set prefix for dialog', () => {
const { hide } = Dialog.show({
prefix: 'test-',
title: 'Title',
content: 'Content',
});

assert(
hasClass(document.querySelector('.test-dialog'), 'test-closeable')
);

hide();
});

it('should throw error (async)', () => {
const { hide } = Dialog.show({
title: 'Title',
Expand Down

0 comments on commit 7d458d4

Please sign in to comment.