UNPKG

bootbox

Version:

Wrappers for JavaScript alert(), confirm() and other flexible dialogs using Twitter's bootstrap framework

62 lines (47 loc) 1.53 kB
require('./vendor/setup'); var assert = require('assert'); var bootbox = require('../'); describe("animate", function() { var box; before(function() { bootbox.animate(false); }); after(function() { $(".bootbox") .modal('hide') .remove(); }); describe("when disabled", function() { before(function() { box = bootbox.dialog("foo"); }); it("should not apply the fade class to the modal", function() { assert.ok(!box.hasClass("fade")); }); describe("but when passed as an option", function() { before(function() { box = bootbox.dialog("foo", [], {"animate": true}); }); it("should apply the fade class to the modal", function() { assert.ok(box.hasClass("fade")); }); }); }); describe("when enabled", function() { before(function() { bootbox.animate(true); box = bootbox.dialog("foo"); }); it("should apply the fade class to the modal", function() { assert.ok(box.hasClass("fade")); }); describe("but when passed as false an option", function() { before(function() { box = bootbox.dialog("foo", [], {"animate": false}); }); it("should not apply the fade class to the modal", function() { assert.ok(!box.hasClass("fade")); }); }); }); });