Skip to content

Commit

Permalink
Merge bc2865a into afc4326
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Aug 5, 2019
2 parents afc4326 + bc2865a commit 286007e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/dom/renderers/renderActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const renderActions = (instance, params) => {

// Actions (buttons) wrapper
if (!params.showConfirmButton && !params.showCancelButton) {
return dom.hide(actions)
dom.hide(actions)
}

// Custom class
Expand Down
16 changes: 15 additions & 1 deletion test/qunit/methods/showLoading.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { Swal, ensureClosed } from '../helpers.js'
import { Swal, ensureClosed, isHidden, isVisible } from '../helpers.js'

QUnit.test('should open an empty popup with loader', (assert) => {
ensureClosed()
Swal.showLoading()
assert.ok(Swal.isVisible())
assert.ok(Swal.getActions().classList.contains('swal2-loading'))
})

QUnit.test('showConfirmButton: false + showLoading()', (assert) => {
const done = assert.async()
Swal.fire({
showConfirmButton: false,
onOpen: () => {
Swal.showLoading()
assert.ok(Swal.getActions().classList.contains('swal2-loading'))
assert.ok(isVisible(Swal.getConfirmButton()))
assert.ok(isHidden(Swal.getCancelButton()))
done()
},
})
})

0 comments on commit 286007e

Please sign in to comment.