Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable the resize checker in the tests #2427

Merged
merged 1 commit into from
Dec 29, 2014
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion src/kibana/components/vislib/lib/resize_checker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
return function ResizeCheckerFactory(Private, Notifier) {
return function ResizeCheckerFactory(Private, Notifier, $rootScope) {
var $ = require('jquery');
var _ = require('lodash');

Expand Down Expand Up @@ -128,6 +128,8 @@ define(function (require) {
* @return {void}
*/
ResizeChecker.prototype.check = function () {
if (window.DISABLE_RESIZE_CHECKER) return;

var newSize = this.read();
var dirty = this.saveSize(newSize);
var dirtyChanged = this.saveDirty(dirty);
Expand Down Expand Up @@ -155,6 +157,8 @@ define(function (require) {
* @return {integer} - the id of the next timer
*/
ResizeChecker.prototype.startSchedule = function (schedule) {
if (window.DISABLE_RESIZE_CHECKER) return;

this._tick = -1;
this._currentSchedule = schedule;
return this.continueSchedule();
Expand All @@ -167,6 +171,8 @@ define(function (require) {
* @return {integer} - the id of the next timer
*/
ResizeChecker.prototype.continueSchedule = function () {
if (window.DISABLE_RESIZE_CHECKER) return;

clearTimeout(this._timerId);

if (this._tick < this._currentSchedule.length - 1) {
Expand Down
1 change: 1 addition & 0 deletions test/unit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script>(function () {
var COVERAGE = !!(/coverage/i.test(window.location.search));
var SAUCELABS = !!(/saucelabs/i.test(window.location.search));
var DISABLE_RESIZE_CHECKER = true;

mocha.setup({
ui: 'bdd',
Expand Down
2 changes: 2 additions & 0 deletions test/unit/specs/vislib/lib/resize_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define(function (require) {

beforeEach(module('kibana'));
beforeEach(inject(function (Private) {
window.DISABLE_RESIZE_CHECKER = false;
ResizeChecker = Private(require('components/vislib/lib/resize_checker'));
EventEmitter = Private(require('factories/events'));
reflowWatcher = Private(require('components/reflow_watcher'));
Expand All @@ -30,6 +31,7 @@ define(function (require) {
}));

afterEach(function () {
window.DISABLE_RESIZE_CHECKER = true;
checker.$el.remove();
checker.destroy();
});
Expand Down