Skip to content

Commit

Permalink
add tests for proper destruct of popup
Browse files Browse the repository at this point in the history
  • Loading branch information
aristov committed Apr 6, 2015
1 parent 5838c6f commit 5b64198
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions common.blocks/dropdown/dropdown.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
modules.define(
'spec',
['dropdown', 'i-bem__dom', 'jquery', 'BEMHTML'],
function(provide, Dropdown, BEMDOM, $, BEMHTML) {
['dropdown', 'i-bem__dom', 'jquery', 'BEMHTML', 'sinon'],
function(provide, Dropdown, BEMDOM, $, BEMHTML, sinon) {

describe('dropdown', function() {
var body = $('body'),
Expand Down Expand Up @@ -69,6 +69,17 @@ describe('dropdown', function() {
.hasMod('opened').should.be.false;
});
});

describe('destruct', function() {
it('should destruct properly', function() {
var spy = sinon.spy();

dropdown.getPopup().on({ modName : 'js', modVal : '' }, spy);

This comment has been minimized.

Copy link
@aristov

aristov May 14, 2015

Author Contributor

TODO: add dropdown.setMod('opened')

BEMDOM.destruct(dropdown.domElem);

spy.should.have.been.calledOnce;
});
});
});

provide();
Expand Down

0 comments on commit 5b64198

Please sign in to comment.