[es-browser] fix load order issues

This commit is contained in:
spalger 2016-02-08 17:35:32 -07:00
parent be40e9800b
commit b9e8a8619b
4 changed files with 23 additions and 12 deletions

View file

@ -1,5 +1,7 @@
import angular from 'angular';
import 'angular-mocks';
import 'mocha';
if (angular.mocks) {
throw new Error(
'Don\'t require angular-mocks directly or the tests ' +

View file

@ -152,7 +152,7 @@ describe('timepicker directive', function () {
it('should default the interval on the courier with incorrect values', function (done) {
// Change refresh interval and digest
$scope.setRefreshInterval('undefined');
$scope.setRefreshInterval();
$elem.scope().$digest();
expect($courier.searchLooper.loopInterval()).to.be(0);
done();

View file

@ -145,7 +145,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
};
$scope.setRefreshInterval = function (interval) {
interval = _.clone(interval);
interval = _.clone(interval || {});
notify.log('before: ' + interval.pause);
interval.pause = (interval.pause == null || interval.pause === false) ? false : true;
@ -158,4 +158,3 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
}
};
});

View file

@ -1,18 +1,28 @@
import Scanner from 'ui/utils/scanner';
import expect from 'expect.js';
import Bluebird from 'bluebird';
import elasticsearch from 'elasticsearch-browser';
import 'elasticsearch-browser';
import ngMock from 'ngMock';
import sinon from 'sinon';
var es = new elasticsearch.Client({
host: 'http://localhost:9210',
defer: function () {
return Bluebird.defer();
}
});
describe('Scanner', function () {
let es;
beforeEach(ngMock.module('kibana'));
beforeEach(ngMock.inject(function (esFactory) {
es = esFactory({
host: 'http://localhost:9210',
defer: function () {
return Bluebird.defer();
}
});
}));
afterEach(function () {
es.close();
es = null;
});
describe('initialization', function () {
it('should throw errors if missing arguments on initialization', function () {
expect(() => new Scanner()).to.throwError();