Skip to content

Commit

Permalink
Added tests for #149 #118
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpapa committed Apr 29, 2014
1 parent 3126a53 commit f64ae98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion tests/toastr-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ <h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../bower_components/jquery/jquery.js" type="text/javascript"></script>
<script src="../toastr.js" type="text/javascript"></script>
<script src="qunit/qunit.js" type="text/javascript"></script>
<script src="unit/toastr-tests.js" type="text/javascript"></script>
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/toastr-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
$toast[2] = toastr.info(sampleMsg, sampleTitle + '-3-Visible');
//Assert
equal($toast[2].find('div.toast-title').html(), sampleTitle + '-3-Visible', 'Finds toast after a clear');
ok($toast[2].find('div.toast-title').find(':visible'), 'Toast after a clear is visible');
ok($toast[2].is(':visible'), 'Toast after a clear is visible');
//Teardown
resetContainer();
start();
}, delay);
});
asyncTest('clear and show - clear removes toast container', 1, function () {
asyncTest('clear and show - clear removes toast container', 2, function () {
//Arrange
var $toast = [];
$toast[0] = toastr.info(sampleMsg, sampleTitle + '-1');
Expand All @@ -102,6 +102,7 @@
setTimeout(function () {
//Assert
equal($(selectors.container).length, 0, 'Toast container does not exist');
ok(!$toast[1].is(':visible'), 'Toast after a clear is visible');
//Teardown
resetContainer();
start();
Expand Down Expand Up @@ -132,7 +133,9 @@
toastr.clear();
$toast[2] = toastr.info(sampleMsg, sampleTitle + '-3-Visible');
//Assert
equal($(selectors.container).find('div.toast-title').html(), sampleTitle + '-3-Visible', 'Finds toast after a clear'); //Teardown
ok($toast[2].is(':visible'), 'Toast after a clear is visible');
//Teardown
resetContainer();
});
module('info');
test('info - pass title and message', 3, function () {
Expand Down

0 comments on commit f64ae98

Please sign in to comment.