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 Jun 10, 2015
1 parent 1349fe1 commit e7593af
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);
BEMDOM.destruct(dropdown.domElem);

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

provide();
Expand Down

0 comments on commit e7593af

Please sign in to comment.