Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var undef,
expect = chai.expect;

describe('DOM events', function() {
var Block1, Block2, Block3, block1, spy1, spy2, spy3, spy4, spy5, spy6, spy7, spy8,
var Block1, Block2, Block3, block1, spy1, spy2, spy3, spy4, spy5, spy6, spy7, spy8, spy9,
wrapSpy = function(spy) {
return function(e) {
// NOTE: we need to pass bemTarget and data explicitly, as `e` is being
Expand All @@ -26,6 +26,7 @@ describe('DOM events', function() {
spy6 = sinon.spy();
spy7 = sinon.spy();
spy8 = sinon.spy();
spy9 = sinon.spy();
});

afterEach(function() {
Expand Down Expand Up @@ -1032,6 +1033,24 @@ describe('DOM events', function() {
});
});
});

describe('window events', function() {
beforeEach(function() {
Block1 = bemDom.declBlock('block1', {}, {
onInit : function() {
this._domEvents(window).on('resize', spy9);
}
});

block1 = initDom({ block : 'block1' }).bem(Block1);
});

it('should properly bind handlers', function() {
bemDom.win.trigger('resize');

spy9.should.have.been.called;
});
});
});
});

Expand Down