Skip to content

Commit

Permalink
Update tests after #186
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Oct 12, 2015
1 parent a458997 commit 5a9961a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions test/remodal.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@
<div data-remodal-id="modal3">
<a data-remodal-action="close" class="remodal-close"></a>
</div>

<div class="remodal" data-remodal-id="!modal4/test">
<a data-remodal-action="close" class="remodal-close"></a>
</div>
</body>
</html>
18 changes: 15 additions & 3 deletions test/remodal_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
var $elem = $('[data-remodal-id=modal3]');

assert.ok($elem.remodal(), 'instance exists');
assert.equal($elem.data('remodal'), 2, 'index is right');
});

QUnit.asyncTest('Hash tracking', function(assert) {
Expand All @@ -54,6 +53,19 @@
location.hash = '#modal';
});

QUnit.asyncTest('Support of special symbols in the id attribute', function(assert) {
$document.one('opened', '[data-remodal-id="!modal4/test"]', function() {
assert.ok(true, 'the modal is opened');
location.hash = '#';
});

$document.one('closed', '[data-remodal-id="!modal4/test"]', function() {
QUnit.start();
});

location.hash = '#!modal4/test';
});

QUnit.asyncTest('`data-remodal-target` directive', function(assert) {
$document.one('opened', '[data-remodal-id=modal]', function() {
assert.ok(true, 'the modal is opened');
Expand Down Expand Up @@ -233,7 +245,7 @@
}).length;

assert.equal($('[data-remodal-id=modal4]').length, 1, 'modal exists');
assert.equal(instanceCount, 4, 'count of instances is right');
assert.equal(instanceCount, 5, 'count of instances is right');

remodal.destroy();

Expand All @@ -242,7 +254,7 @@
}).length;

assert.equal($('[data-remodal-id=modal4]').length, 0, 'modal does not exist');
assert.equal(instanceCount, 3, 'count of instances is right');
assert.equal(instanceCount, 4, 'count of instances is right');
});

QUnit.asyncTest('Lock/unlock the scroll bar', function(assert) {
Expand Down

0 comments on commit 5a9961a

Please sign in to comment.