Skip to content

Commit

Permalink
tests for #12
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Dec 23, 2015
1 parent f6e03d6 commit 5957ebb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/jquery.fenster.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@
this.element.trigger('click');

setTimeout(function () {
this.setHolder(this.element.data('jqFensterHolder'));
this.getHolder().on('jqFensterCallbackClose', this.close.bind(this));
this.setHolder(
this.element.data('jqFensterHolder')
.on('jqFensterCallbackClose', this.close.bind(this))
);
cbToExecute.call(this);
}.bind(this), this.options.delayOpen);

Expand Down
15 changes: 15 additions & 0 deletions src/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,18 @@ asyncTest('Dynamic instance', 10, function() {
}, animationDelay);
}, animationDelay);
});

asyncTest('Issue #12', 1, function() {
var modal = $.fenster('#targetSecond').open();
setTimeout(function () {
$('a.jqFensterClose:visible').click();
setTimeout(function () {
modal.open();
equal(modal.element.data('jqFensterHolder').length, 1);
setTimeout(function () {
modal.destroy();
start();
}, animationDelay);
}, animationDelay);
}, animationDelay);
});

0 comments on commit 5957ebb

Please sign in to comment.