it("must ignore resize and orientation change when the flag is off", function() { var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: false}); var adUnit = new FakeAdUnit(); vpaidIntegrator._setupEvents(adUnit, new VASTResponse(), utilities.noop); dom.dispatchEvent(window, new Event('orientationchange')); dom.dispatchEvent(window, new Event('resize')); assert.equal(adUnit.resizeAd.callCount, 0); });
it("must handle window orientation change", function() { var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: true}); var adUnit = new FakeAdUnit(); vpaidIntegrator._setupEvents(adUnit, new VASTResponse(), utilities.noop); dom.dispatchEvent(window, new Event('orientationchange')); assert(adUnit.resizeAd.calledOnce); });