Skip to content

Commit

Permalink
add test around conditional prompt show logic
Browse files Browse the repository at this point in the history
  • Loading branch information
makeusabrew committed Aug 25, 2013
1 parent 9f613de commit bc04083
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 0 additions & 6 deletions tests/bootbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ describe("Bootbox", function() {
expect(bootbox.hideAll).to.be.a("function");
});

// @TODO reimplement
xit("starts with no dialogs in the DOM", function() {
expect($(".bootbox").length).to.equal(0);
});

// @TODO reimplement
describe("hideAll", function() {
beforeEach(function() {
this.hidden = sinon.spy($.fn, "modal");
Expand Down
15 changes: 10 additions & 5 deletions tests/prompt.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,21 @@ describe "bootbox.prompt", ->
expect(@button.text()).to.equal "Custom prompt"
expect(@button.hasClass("btn-warning")).to.be.true

# @FIXME even if false, our tests always report dialog.is(":visible") true
# even though a browser does not (as you'd expect)
xdescribe "setting show to false", ->
describe "setting show to false", ->
beforeEach ->
@options.show = false
@options.show = true

@shown = sinon.spy()

sinon.stub bootbox, "dialog", =>
on: ->
off: ->
modal: @shown

@create()

it "does not show the dialog", ->
expect(@dialog.is(":visible")).to.be.false
expect(@shown).not.to.have.been.called

describe "callback tests", ->
describe "with a simple callback", ->
Expand Down

0 comments on commit bc04083

Please sign in to comment.