From 998c3724e80f7687eed747104e91b8ed773a3d54 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Wed, 18 Jun 2014 21:34:21 +0200 Subject: [PATCH] Clean modal unit tests up --- js/tests/unit/modal.js | 147 ++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 84 deletions(-) diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 7a0660ea20..6c48ed44b4 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -4,8 +4,7 @@ $(function () { module('modal plugin') test('should be defined on jquery object', function () { - var div = $('') - ok(div.modal, 'modal method is defined') + ok($(document.body).modal, 'modal method is defined') }) module('modal', { @@ -20,13 +19,14 @@ $(function () { }) test('should provide no conflict', function () { - ok(!$.fn.modal, 'modal was set back to undefined (orig value)') + strictEqual($.fn.modal, undefined, 'modal was set back to undefined (orig value)') }) - test('should return element', function () { - var div = $('') - ok(div.bootstrapModal() == div, 'document.body returned') - $('#modal-test').remove() + test('should return jquery collection containing the element', function () { + var $el = $('