[es-browser] fix load order issues
This commit is contained in:
parent
be40e9800b
commit
b9e8a8619b
|
@ -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 ' +
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
|||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue