move to ngMock module
This commit is contained in:
parent
15864363d5
commit
75d0b074cd
|
@ -52,9 +52,7 @@ module.exports = function (kbnServer) {
|
||||||
let deps = [];
|
let deps = [];
|
||||||
let modules = {
|
let modules = {
|
||||||
angular: [],
|
angular: [],
|
||||||
require: [
|
require: []
|
||||||
'angular-mocks'
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (testFiles) {
|
if (testFiles) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ module.exports = function devModePlugin(kibana) {
|
||||||
|
|
||||||
let fromRoot = require('../../utils/fromRoot');
|
let fromRoot = require('../../utils/fromRoot');
|
||||||
let pathContains = require('../../utils/pathContains');
|
let pathContains = require('../../utils/pathContains');
|
||||||
|
let UiApp = require('../../server/ui/UiApp');
|
||||||
|
|
||||||
const SRC = fromRoot('src');
|
const SRC = fromRoot('src');
|
||||||
const UI = fromRoot('src/ui');
|
const UI = fromRoot('src/ui');
|
||||||
|
@ -22,94 +23,96 @@ module.exports = function devModePlugin(kibana) {
|
||||||
|
|
||||||
return new kibana.Plugin({
|
return new kibana.Plugin({
|
||||||
init: function (server, options) {
|
init: function (server, options) {
|
||||||
server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
|
|
||||||
server.ext('onPreHandler', istanbul({ root: UI, displayRoot: SRC, filter: kibanaSrcFilter }));
|
|
||||||
|
|
||||||
server.setupViews(__dirname);
|
|
||||||
|
|
||||||
let TestHarnessBuilder; // initialized in mixin below
|
|
||||||
let currentBuilder = null;
|
|
||||||
|
|
||||||
function getBuilder(path) {
|
|
||||||
if (!currentBuilder || currentBuilder.path !== path) {
|
|
||||||
currentBuilder = new TestHarnessBuilder(path);
|
|
||||||
}
|
|
||||||
return currentBuilder;
|
|
||||||
}
|
|
||||||
|
|
||||||
server.decorate('reply', 'renderTestHarness', function (path) {
|
|
||||||
let reply = this;
|
|
||||||
|
|
||||||
getBuilder(path).render().then(function (output) {
|
|
||||||
if (!output || !output.bundle) {
|
|
||||||
return reply(Boom.create(500, 'failed to build test bundle'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return reply(output.bundle).type('application/javascript');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
server.decorate('reply', 'renderTestHarnessSourceMap', function (path) {
|
|
||||||
let reply = this;
|
|
||||||
|
|
||||||
getBuilder(path).render().then(function (output) {
|
|
||||||
if (!output) {
|
|
||||||
return reply(Boom.create(500, 'failed to build test bundle'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!output.map) {
|
|
||||||
return reply(Boom.notFound());
|
|
||||||
}
|
|
||||||
|
|
||||||
reply(output.map);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
server.redirectToSlash('/tests/plugins/{pluginId}');
|
|
||||||
|
|
||||||
server.route({
|
|
||||||
path: '/tests/plugins/{pluginId}/',
|
|
||||||
method: 'GET',
|
|
||||||
config: {
|
|
||||||
pre: [
|
|
||||||
'kbnPluginById(params.pluginId)'
|
|
||||||
],
|
|
||||||
handler: function (req, reply) {
|
|
||||||
return reply.view('testHarness.jade', {
|
|
||||||
bundlePath: `/testBundle/plugins/${req.params.pluginId}/`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
server.route({
|
|
||||||
path: '/testBundle/plugins/{pluginId}/',
|
|
||||||
method: 'GET',
|
|
||||||
config: {
|
|
||||||
pre: [
|
|
||||||
'kbnPluginById(params.pluginId)'
|
|
||||||
],
|
|
||||||
handler: function (req, reply) {
|
|
||||||
return reply.renderTestHarness(req.pre.kbnPluginById.publicDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
server.route({
|
|
||||||
path: '/testBundle/plugins/{pluginId}/*.map',
|
|
||||||
method: 'GET',
|
|
||||||
config: {
|
|
||||||
pre: [
|
|
||||||
'kbnPluginById(params.pluginId)'
|
|
||||||
],
|
|
||||||
handler: function (req, reply) {
|
|
||||||
return reply.renderTestHarnessSourceMap(req.pre.kbnPluginById.publicDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return kibana.mixin(function (kbnServer) {
|
return kibana.mixin(function (kbnServer) {
|
||||||
TestHarnessBuilder = require('./TestHarnessBuilder')(kbnServer);
|
|
||||||
|
let TestHarnessBuilder = require('./TestHarnessBuilder')(kbnServer);
|
||||||
|
|
||||||
|
server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
|
||||||
|
server.ext('onPreHandler', istanbul({ root: UI, displayRoot: SRC, filter: kibanaSrcFilter }));
|
||||||
|
server.setupViews(resolve(__dirname, 'views'));
|
||||||
|
|
||||||
|
server.redirectToSlash('/testUtils/plugins/{pluginId}');
|
||||||
|
|
||||||
|
let currentBuilder = null;
|
||||||
|
server.decorate('reply', 'renderTestPart', function (basePath, part, mimeType) {
|
||||||
|
let reply = this;
|
||||||
|
|
||||||
|
if (!currentBuilder || currentBuilder.path !== basePath) {
|
||||||
|
currentBuilder = new TestHarnessBuilder(basePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentBuilder.render().then(function (output) {
|
||||||
|
if (!output || !output.bundle) {
|
||||||
|
return reply(Boom.create(500, 'failed to build test bundle'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return reply(output[part]).type(mimeType);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
server.route({
|
||||||
|
path: '/tests/plugins/{pluginId}/',
|
||||||
|
method: 'GET',
|
||||||
|
config: {
|
||||||
|
pre: [
|
||||||
|
'kbnPluginById(params.pluginId)'
|
||||||
|
],
|
||||||
|
handler: function (req, reply) {
|
||||||
|
let pluginId = req.params.pluginId;
|
||||||
|
|
||||||
|
let app = new UiApp(kbnServer.uiExports, {
|
||||||
|
id: `tests/plugins/${pluginId}`,
|
||||||
|
main: `/testBundle/plugins/${pluginId}/`,
|
||||||
|
autoload: {
|
||||||
|
angular: [],
|
||||||
|
require: []
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return reply.renderApp(app, 'testHarness');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
server.route({
|
||||||
|
path: '/testBundle/plugins/{pluginId}/',
|
||||||
|
method: 'GET',
|
||||||
|
config: {
|
||||||
|
pre: [
|
||||||
|
'kbnPluginById(params.pluginId)'
|
||||||
|
],
|
||||||
|
handler: function (req, reply) {
|
||||||
|
return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'bundle', 'application/javascript');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
server.route({
|
||||||
|
path: '/testBundle/plugins/{pluginId}/*.map',
|
||||||
|
method: 'GET',
|
||||||
|
config: {
|
||||||
|
pre: [
|
||||||
|
'kbnPluginById(params.pluginId)'
|
||||||
|
],
|
||||||
|
handler: function (req, reply) {
|
||||||
|
return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'sourceMap', 'text/plain');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
server.route({
|
||||||
|
path: '/testBundle/plugins/{pluginId}/css',
|
||||||
|
method: 'GET',
|
||||||
|
config: {
|
||||||
|
pre: [
|
||||||
|
'kbnPluginById(params.pluginId)'
|
||||||
|
],
|
||||||
|
handler: function (req, reply) {
|
||||||
|
return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'style', 'text/css');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -119,6 +122,7 @@ module.exports = function devModePlugin(kibana) {
|
||||||
],
|
],
|
||||||
|
|
||||||
modules: {
|
modules: {
|
||||||
|
ngMock$: 'plugins/devMode/ngMock',
|
||||||
sinon$: {
|
sinon$: {
|
||||||
path: fromRoot('node_modules/sinon/pkg/sinon.js'),
|
path: fromRoot('node_modules/sinon/pkg/sinon.js'),
|
||||||
parse: false
|
parse: false
|
||||||
|
@ -127,13 +131,19 @@ module.exports = function devModePlugin(kibana) {
|
||||||
testUtils: fromRoot('src/testUtils'),
|
testUtils: fromRoot('src/testUtils'),
|
||||||
mocha$: {
|
mocha$: {
|
||||||
path: fromRoot('node_modules/mocha/mocha.js'),
|
path: fromRoot('node_modules/mocha/mocha.js'),
|
||||||
exports: 'window.mocha'
|
exports: 'window.mocha',
|
||||||
|
imports: 'mochaStyles'
|
||||||
},
|
},
|
||||||
|
mochaStyles$: fromRoot('node_modules/mocha/mocha.css'),
|
||||||
'angular-mocks': {
|
'angular-mocks': {
|
||||||
path: require.resolve('angular-mocks'),
|
path: require.resolve('angular-mocks'),
|
||||||
imports: 'angular,mocha'
|
imports: 'angular,mocha'
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
|
loaders: [
|
||||||
|
{ test: /\/__tests__\//, loader: 'imports?mocha' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
103
src/plugins/devMode/public/bootstrap.js
vendored
103
src/plugins/devMode/public/bootstrap.js
vendored
|
@ -25,66 +25,63 @@ function setupCoverage(done) {
|
||||||
mocha.reporter(require('testUtils/istanbul_reporter/reporter'));
|
mocha.reporter(require('testUtils/istanbul_reporter/reporter'));
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.bootstrap = function (kibana, sinon) {
|
exports.bootstrap = function () {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
var sinon = require('sinon');
|
||||||
|
|
||||||
$(function () {
|
var _desc = window.describe;
|
||||||
var _desc = window.describe;
|
window.describe = _.wrap(_desc, unwindDescribeArrays);
|
||||||
window.describe = _.wrap(_desc, unwindDescribeArrays);
|
window.describe.only = _.wrap(_desc.only, unwindDescribeArrays);
|
||||||
window.describe.only = _.wrap(_desc.only, unwindDescribeArrays);
|
|
||||||
|
|
||||||
if (COVERAGE) {
|
$('#mocha').html('');
|
||||||
setupCoverage();
|
|
||||||
}
|
|
||||||
|
|
||||||
kibana.load(startMocha);
|
if (COVERAGE) {
|
||||||
|
setupCoverage();
|
||||||
|
}
|
||||||
|
|
||||||
function startMocha() {
|
require('ui/chrome').setupAngular();
|
||||||
var xhr = sinon.useFakeXMLHttpRequest();
|
|
||||||
window.mochaRunner = mocha.run().on('end', function () {
|
|
||||||
window.mochaResults = this.stats;
|
|
||||||
window.mochaResults.details = getFailedTests(this);
|
|
||||||
xhr.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
mocha.run();
|
var xhr = sinon.useFakeXMLHttpRequest();
|
||||||
}
|
window.mochaRunner = mocha.run().on('end', function () {
|
||||||
|
window.mochaResults = this.stats;
|
||||||
function getFailedTests(runner) {
|
window.mochaResults.details = getFailedTests(this);
|
||||||
var fails = [];
|
xhr.restore();
|
||||||
var suiteStack = [];
|
|
||||||
(function recurse(suite) {
|
|
||||||
suiteStack.push(suite);
|
|
||||||
(suite.tests || [])
|
|
||||||
.filter(function (test) {
|
|
||||||
return test.state && test.state !== 'passed' && test.state !== 'pending';
|
|
||||||
})
|
|
||||||
.forEach(function (test) {
|
|
||||||
fails.push({
|
|
||||||
title: suiteStack.concat(test).reduce(function (title, suite) {
|
|
||||||
if (suite.title) {
|
|
||||||
return (title ? title + ' ' : '') + suite.title;
|
|
||||||
} else {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
}, ''),
|
|
||||||
err: test.err ? (test.err.stack || test.err.message) : 'unknown error'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(suite.suites || []).forEach(recurse);
|
|
||||||
suiteStack.pop();
|
|
||||||
}(runner.suite));
|
|
||||||
return fails;
|
|
||||||
}
|
|
||||||
|
|
||||||
function unwindDescribeArrays(fn, name, body) {
|
|
||||||
if (!body && name && name instanceof Array) {
|
|
||||||
body = name[1];
|
|
||||||
name = name[0];
|
|
||||||
}
|
|
||||||
return fn.call(this, name, body);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function getFailedTests(runner) {
|
||||||
|
var fails = [];
|
||||||
|
var suiteStack = [];
|
||||||
|
(function recurse(suite) {
|
||||||
|
suiteStack.push(suite);
|
||||||
|
(suite.tests || [])
|
||||||
|
.filter(function (test) {
|
||||||
|
return test.state && test.state !== 'passed' && test.state !== 'pending';
|
||||||
|
})
|
||||||
|
.forEach(function (test) {
|
||||||
|
fails.push({
|
||||||
|
title: suiteStack.concat(test).reduce(function (title, suite) {
|
||||||
|
if (suite.title) {
|
||||||
|
return (title ? title + ' ' : '') + suite.title;
|
||||||
|
} else {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
}, ''),
|
||||||
|
err: test.err ? (test.err.stack || test.err.message) : 'unknown error'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(suite.suites || []).forEach(recurse);
|
||||||
|
suiteStack.pop();
|
||||||
|
}(runner.suite));
|
||||||
|
return fails;
|
||||||
|
}
|
||||||
|
|
||||||
|
function unwindDescribeArrays(fn, name, body) {
|
||||||
|
if (!body && _.isArray(name)) {
|
||||||
|
body = name[1];
|
||||||
|
name = name[0];
|
||||||
|
}
|
||||||
|
return fn.call(this, name, body);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
2
src/plugins/devMode/public/ngMock.js
Normal file
2
src/plugins/devMode/public/ngMock.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
require('angular-mocks');
|
||||||
|
module.exports = require('angular').mock;
|
|
@ -1,7 +0,0 @@
|
||||||
doctype html
|
|
||||||
html
|
|
||||||
head
|
|
||||||
title Kibana4 Tests
|
|
||||||
script(async, src=bundlePath)
|
|
||||||
body
|
|
||||||
#mocha Loading tests, please wait.
|
|
8
src/plugins/devMode/views/testHarness.jade
Normal file
8
src/plugins/devMode/views/testHarness.jade
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
extends ../../../server/ui/views/chrome.jade
|
||||||
|
|
||||||
|
block head
|
||||||
|
link(rel='stylesheet', href='#{app.main}css')
|
||||||
|
|
||||||
|
block content
|
||||||
|
#mocha
|
||||||
|
script(async src=app.main)
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
@ -12,7 +13,7 @@ define(function (require) {
|
||||||
var $parentScope, $scope, indexPattern;
|
var $parentScope, $scope, indexPattern;
|
||||||
|
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
_.assign($parentScope, props);
|
_.assign($parentScope, props);
|
||||||
$compile($elem)($parentScope);
|
$compile($elem)($parentScope);
|
||||||
|
@ -42,10 +43,10 @@ define(function (require) {
|
||||||
describe('discoverField', function () {
|
describe('discoverField', function () {
|
||||||
var $elem;
|
var $elem;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$elem = angular.element('<discover-field></discover-field>');
|
$elem = angular.element('<discover-field></discover-field>');
|
||||||
inject(function (Private) {
|
ngMock.inject(function (Private) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
});
|
});
|
||||||
init($elem, {
|
init($elem, {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var fieldCalculator = require('plugins/kibana/discover/components/field_chooser/lib/field_calculator');
|
var fieldCalculator = require('plugins/kibana/discover/components/field_chooser/lib/field_calculator');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
|
@ -9,9 +10,9 @@ define(function (require) {
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
|
||||||
describe('fieldCalculator', function () {
|
describe('fieldCalculator', function () {
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
inject(function (Private) {
|
ngMock.inject(function (Private) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
@ -18,7 +19,7 @@ define(function (require) {
|
||||||
|
|
||||||
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
|
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
inject(function ($rootScope, $compile, $timeout, _config_) {
|
ngMock.inject(function ($rootScope, $compile, $timeout, _config_) {
|
||||||
config = _config_;
|
config = _config_;
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
_.assign($parentScope, props);
|
_.assign($parentScope, props);
|
||||||
|
@ -52,9 +53,9 @@ define(function (require) {
|
||||||
'</disc-field-chooser>'
|
'</disc-field-chooser>'
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
inject(function (Private) {
|
ngMock.inject(function (Private) {
|
||||||
hits = Private(require('fixtures/hits'));
|
hits = Private(require('fixtures/hits'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
indexPatternList = [ 'b', 'a', 'c' ];
|
indexPatternList = [ 'b', 'a', 'c' ];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
require('angular').module('hitSortFunctionTests', ['kibana']);
|
require('angular').module('hitSortFunctionTests', ['kibana']);
|
||||||
|
@ -7,8 +8,8 @@ define(function (require) {
|
||||||
describe('hit sort function', function () {
|
describe('hit sort function', function () {
|
||||||
var createHitSortFn;
|
var createHitSortFn;
|
||||||
|
|
||||||
beforeEach(module('hitSortFunctionTests'));
|
beforeEach(ngMock.module('hitSortFunctionTests'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
createHitSortFn = Private(require('plugins/kibana/discover/_hit_sort_fn'));
|
createHitSortFn = Private(require('plugins/kibana/discover/_hit_sort_fn'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('angular-route');
|
require('angular-route');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
require('plugins/kibana/doc/index');
|
require('plugins/kibana/doc/index');
|
||||||
|
|
||||||
|
@ -9,10 +10,10 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function (index, type, id) {
|
var init = function (index, type, id) {
|
||||||
|
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Stub services
|
// Stub services
|
||||||
module(function ($provide) {
|
ngMock.module(function ($provide) {
|
||||||
$provide.service('$route', function (Private) {
|
$provide.service('$route', function (Private) {
|
||||||
this.current = {
|
this.current = {
|
||||||
locals: {
|
locals: {
|
||||||
|
@ -65,7 +66,7 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $controller, _timefilter_) {
|
ngMock.inject(function ($rootScope, $controller, _timefilter_) {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
timefilter = _timefilter_;
|
timefilter = _timefilter_;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
|
|
||||||
require('plugins/kibana/visualize/editor/agg');
|
require('plugins/kibana/visualize/editor/agg');
|
||||||
|
@ -42,7 +43,7 @@ define(function (require) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|
||||||
$parentScope.agg = {
|
$parentScope.agg = {
|
||||||
|
@ -59,7 +60,7 @@ define(function (require) {
|
||||||
schema: makeConfig('radius')
|
schema: makeConfig('radius')
|
||||||
}];
|
}];
|
||||||
});
|
});
|
||||||
beforeEach(inject(function ($rootScope, $compile) {
|
beforeEach(ngMock.inject(function ($rootScope, $compile) {
|
||||||
// share the scope
|
// share the scope
|
||||||
_.defaults($parentScope, $rootScope, Object.getPrototypeOf($rootScope));
|
_.defaults($parentScope, $rootScope, Object.getPrototypeOf($rootScope));
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('markdown vis controller', function () {
|
describe('markdown vis controller', function () {
|
||||||
var $scope, $el;
|
var $scope, $el;
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
beforeEach(module('kibana/markdown_vis'));
|
beforeEach(ngMock.module('kibana/markdown_vis'));
|
||||||
beforeEach(inject(function ($rootScope, $controller) {
|
beforeEach(ngMock.inject(function ($rootScope, $controller) {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
$controller('KbnMarkdownVisController', {$scope: $scope});
|
$controller('KbnMarkdownVisController', {$scope: $scope});
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('metric vis', function () {
|
describe('metric vis', function () {
|
||||||
var $scope;
|
var $scope;
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var formatter = function (value) {
|
var formatter = function (value) {
|
||||||
return value.toFixed(3);
|
return value.toFixed(3);
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(module('kibana/metric_vis'));
|
beforeEach(ngMock.module('kibana/metric_vis'));
|
||||||
beforeEach(inject(function ($rootScope, $controller) {
|
beforeEach(ngMock.inject(function ($rootScope, $controller) {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
$controller('KbnMetricVisController', {$scope: $scope});
|
$controller('KbnMetricVisController', {$scope: $scope});
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
|
||||||
var $rootScope;
|
var $rootScope;
|
||||||
|
@ -14,8 +15,8 @@ define(function (require) {
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var fixtures;
|
var fixtures;
|
||||||
|
|
||||||
beforeEach(module('kibana', 'kibana/table_vis'));
|
beforeEach(ngMock.module('kibana', 'kibana/table_vis'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
$compile = $injector.get('$compile');
|
$compile = $injector.get('$compile');
|
||||||
fixtures = require('fixtures/fake_hierarchical_data');
|
fixtures = require('fixtures/fake_hierarchical_data');
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
|
||||||
var $rootScope;
|
var $rootScope;
|
||||||
|
@ -14,8 +15,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var fixtures;
|
var fixtures;
|
||||||
|
|
||||||
beforeEach(module('kibana', 'kibana/table_vis'));
|
beforeEach(ngMock.module('kibana', 'kibana/table_vis'));
|
||||||
beforeEach(inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
Private = $injector.get('Private');
|
Private = $injector.get('Private');
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
$compile = $injector.get('$compile');
|
$compile = $injector.get('$compile');
|
||||||
|
|
|
@ -63,8 +63,7 @@ class BaseOptimizer extends EventEmitter {
|
||||||
{ test: /\.(html|tmpl)$/, loader: 'raw' },
|
{ test: /\.(html|tmpl)$/, loader: 'raw' },
|
||||||
{ test: /\.png$/, loader: 'url?limit=2048!file?name=[path][name].[ext]' },
|
{ test: /\.png$/, loader: 'url?limit=2048!file?name=[path][name].[ext]' },
|
||||||
{ test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file?name=[path][name].[ext]' },
|
{ test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file?name=[path][name].[ext]' },
|
||||||
{ test: /\/src\/(plugins|ui)\/.+\.js$/, loader: 'auto-preload-rjscommon-deps' },
|
{ test: /\/src\/(plugins|ui)\/.+\.js$/, loader: 'auto-preload-rjscommon-deps' }
|
||||||
{ test: /\/__tests__\//, loader: 'mocha' }
|
|
||||||
].concat(this.modules.loaders),
|
].concat(this.modules.loaders),
|
||||||
noParse: this.modules.noParse,
|
noParse: this.modules.noParse,
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,7 +28,8 @@ module.exports = class LiveOptimizer extends BaseOptimizer {
|
||||||
let self = this;
|
let self = this;
|
||||||
let fs = self.outFs;
|
let fs = self.outFs;
|
||||||
let filename = join(self.compiler.outputPath, `${id}.bundle.js`);
|
let filename = join(self.compiler.outputPath, `${id}.bundle.js`);
|
||||||
let mapFilename = filename + '.map';
|
let mapFilename = join(self.compiler.outputPath, `${id}.bundle.js.map`);
|
||||||
|
let styleFilename = join(self.compiler.outputPath, `${id}.style.css`);
|
||||||
|
|
||||||
self.active = (self.active || self.compile().finally(function () {
|
self.active = (self.active || self.compile().finally(function () {
|
||||||
self.active = null;
|
self.active = null;
|
||||||
|
@ -43,7 +44,8 @@ module.exports = class LiveOptimizer extends BaseOptimizer {
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
bundle: fs.readFileSync(filename),
|
bundle: fs.readFileSync(filename),
|
||||||
map: self.sourceMaps ? fs.readFileSync(mapFilename) : false
|
sourceMap: self.sourceMaps ? fs.readFileSync(mapFilename) : false,
|
||||||
|
style: fs.readFileSync(styleFilename)
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module.exports = function (kbnServer, server, config) {
|
module.exports = function (kbnServer, server, config) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
server.decorate('reply', 'renderApp', function (app) {
|
server.decorate('reply', 'renderApp', function (app, view) {
|
||||||
|
|
||||||
var optimizeStatus = kbnServer.status.get('optimize');
|
var optimizeStatus = kbnServer.status.get('optimize');
|
||||||
switch (optimizeStatus && optimizeStatus.state) {
|
switch (optimizeStatus && optimizeStatus.state) {
|
||||||
|
@ -22,7 +22,6 @@ module.exports = function (kbnServer, server, config) {
|
||||||
|
|
||||||
var payload = {
|
var payload = {
|
||||||
app: app,
|
app: app,
|
||||||
angularModules: app.getModules().angular,
|
|
||||||
appCount: kbnServer.uiExports.apps.length,
|
appCount: kbnServer.uiExports.apps.length,
|
||||||
version: kbnServer.version,
|
version: kbnServer.version,
|
||||||
buildSha: _.get(kbnServer, 'build.sha', '@@buildSha'),
|
buildSha: _.get(kbnServer, 'build.sha', '@@buildSha'),
|
||||||
|
@ -32,7 +31,7 @@ module.exports = function (kbnServer, server, config) {
|
||||||
esShardTimeout: config.get('elasticsearch.shardTimeout')
|
esShardTimeout: config.get('elasticsearch.shardTimeout')
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.view('bootstrap', {
|
return this.view(view || 'uiApp', {
|
||||||
app: app,
|
app: app,
|
||||||
cacheBust: payload.cacheBust,
|
cacheBust: payload.cacheBust,
|
||||||
kibanaPayload: payload
|
kibanaPayload: payload
|
||||||
|
|
|
@ -8,7 +8,7 @@ html(lang='en')
|
||||||
meta(name='viewport', content='width=device-width')
|
meta(name='viewport', content='width=device-width')
|
||||||
link(rel='shortcut icon', href='/ui/images/elk.ico')
|
link(rel='shortcut icon', href='/ui/images/elk.ico')
|
||||||
title Kibana
|
title Kibana
|
||||||
link(rel='stylesheet', href='/bundles/#{app.id}.style.css')
|
block head
|
||||||
body(kbn-chrome)
|
body(kbn-chrome)
|
||||||
script window.__KBN__ = !{j(kibanaPayload)};
|
script window.__KBN__ = !{j(kibanaPayload)};
|
||||||
script(src='/bundles/#{app.id}.bundle.js')
|
block content
|
7
src/server/ui/views/uiApp.jade
Normal file
7
src/server/ui/views/uiApp.jade
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
extends ./chrome.jade
|
||||||
|
|
||||||
|
block head
|
||||||
|
link(rel='stylesheet', href='/bundles/#{app.id}.style.css')
|
||||||
|
|
||||||
|
block content
|
||||||
|
script(src='/bundles/#{app.id}.bundle.js')
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('GeoJson Agg Response Converter', function () {
|
describe('GeoJson Agg Response Converter', function () {
|
||||||
var vis;
|
var vis;
|
||||||
|
@ -9,8 +10,8 @@ define(function (require) {
|
||||||
var esResponse;
|
var esResponse;
|
||||||
var aggs;
|
var aggs;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
var Vis = Private(require('ui/vis/vis'));
|
var Vis = Private(require('ui/vis/vis'));
|
||||||
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var fixtures = require('fixtures/fake_hierarchical_data');
|
var fixtures = require('fixtures/fake_hierarchical_data');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var Vis;
|
var Vis;
|
||||||
var Notifier;
|
var Notifier;
|
||||||
|
@ -12,8 +13,8 @@ define(function (require) {
|
||||||
|
|
||||||
describe('buildHierarchicalData()', function () {
|
describe('buildHierarchicalData()', function () {
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
// stub the error method before requiring vis causes Notifier#error to be bound
|
// stub the error method before requiring vis causes Notifier#error to be bound
|
||||||
Notifier = $injector.get('Notifier');
|
Notifier = $injector.get('Notifier');
|
||||||
sinon.stub(Notifier.prototype, 'error');
|
sinon.stub(Notifier.prototype, 'error');
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var createRawData = require('ui/agg_response/hierarchical/_create_raw_data');
|
var createRawData = require('ui/agg_response/hierarchical/_create_raw_data');
|
||||||
var arrayToLinkedList = require('ui/agg_response/hierarchical/_array_to_linked_list');
|
var arrayToLinkedList = require('ui/agg_response/hierarchical/_array_to_linked_list');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var AggConfigs;
|
var AggConfigs;
|
||||||
var Vis;
|
var Vis;
|
||||||
|
@ -13,9 +14,9 @@ define(function (require) {
|
||||||
describe('createRawData()', function () {
|
describe('createRawData()', function () {
|
||||||
var vis, results;
|
var vis, results;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfigs = Private(require('ui/vis/AggConfigs'));
|
AggConfigs = Private(require('ui/vis/AggConfigs'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -3,11 +3,12 @@ define(function (require) {
|
||||||
describe('transformAggregation()', function () {
|
describe('transformAggregation()', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var transform;
|
var transform;
|
||||||
var fixture;
|
var fixture;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
transform = Private(require('ui/agg_response/hierarchical/_transform_aggregation'));
|
transform = Private(require('ui/agg_response/hierarchical/_transform_aggregation'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
return ['addToSiri', function () {
|
return ['addToSiri', function () {
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var addToSiri;
|
var addToSiri;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
addToSiri = Private(require('ui/agg_response/point_series/_add_to_siri'));
|
addToSiri = Private(require('ui/agg_response/point_series/_add_to_siri'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@ define(function (require) {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
AggType = Private(require('ui/agg_types/_agg_type'));
|
AggType = Private(require('ui/agg_types/_agg_type'));
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var Vis;
|
var Vis;
|
||||||
var Table;
|
var Table;
|
||||||
|
@ -10,8 +11,8 @@ define(function (require) {
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var getAspects;
|
var getAspects;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
Table = Private(require('ui/agg_response/point_series/_add_to_siri'));
|
Table = Private(require('ui/agg_response/point_series/_add_to_siri'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
|
|
|
@ -3,14 +3,15 @@ define(function (require) {
|
||||||
return ['getPoint', function () {
|
return ['getPoint', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var getPoint;
|
var getPoint;
|
||||||
|
|
||||||
var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) };
|
var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) };
|
||||||
var identFormatted = { fieldFormatter: _.constant(_.identity) };
|
var identFormatted = { fieldFormatter: _.constant(_.identity) };
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
getPoint = Private(require('ui/agg_response/point_series/_get_point'));
|
getPoint = Private(require('ui/agg_response/point_series/_get_point'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,13 @@ define(function (require) {
|
||||||
return ['getSeries', function () {
|
return ['getSeries', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var getSeries;
|
var getSeries;
|
||||||
|
|
||||||
var agg = { fieldFormatter: _.constant(_.identity) };
|
var agg = { fieldFormatter: _.constant(_.identity) };
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
getSeries = Private(require('ui/agg_response/point_series/_get_series'));
|
getSeries = Private(require('ui/agg_response/point_series/_get_series'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,12 @@ define(function (require) {
|
||||||
return ['initXAxis', function () {
|
return ['initXAxis', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var initXAxis;
|
var initXAxis;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
initXAxis = Private(require('ui/agg_response/point_series/_init_x_axis'));
|
initXAxis = Private(require('ui/agg_response/point_series/_init_x_axis'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,12 @@ define(function (require) {
|
||||||
return ['initYAxis', function () {
|
return ['initYAxis', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var initYAxis;
|
var initYAxis;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
initYAxis = Private(require('ui/agg_response/point_series/_init_y_axis'));
|
initYAxis = Private(require('ui/agg_response/point_series/_init_y_axis'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,15 @@ define(function (require) {
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var AggConfigResult = require('ui/vis/AggConfigResult');
|
var AggConfigResult = require('ui/vis/AggConfigResult');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var pointSeriesChartDataFromTable;
|
var pointSeriesChartDataFromTable;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var Table;
|
var Table;
|
||||||
var Vis;
|
var Vis;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
Table = Private(require('ui/agg_response/tabify/_table'));
|
Table = Private(require('ui/agg_response/tabify/_table'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var baseArgs = {
|
var baseArgs = {
|
||||||
vis: {
|
vis: {
|
||||||
|
@ -29,8 +30,8 @@ define(function (require) {
|
||||||
|
|
||||||
var orderedDateAxis;
|
var orderedDateAxis;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
orderedDateAxis = Private(require('ui/agg_response/point_series/_ordered_date_axis'));
|
orderedDateAxis = Private(require('ui/agg_response/point_series/_ordered_date_axis'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,12 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var tooltipFormatter;
|
var tooltipFormatter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
tooltipFormatter = Private(require('ui/agg_response/point_series/_tooltip_formatter'));
|
tooltipFormatter = Private(require('ui/agg_response/point_series/_tooltip_formatter'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@ define(function (require) {
|
||||||
return ['Buckets wrapper', function () {
|
return ['Buckets wrapper', function () {
|
||||||
var Buckets;
|
var Buckets;
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
Buckets = Private(require('ui/agg_response/tabify/_buckets'));
|
Buckets = Private(require('ui/agg_response/tabify/_buckets'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,10 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
getColumns = Private(require('ui/agg_response/tabify/_get_columns'));
|
getColumns = Private(require('ui/agg_response/tabify/_get_columns'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -3,14 +3,15 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var fixtures = require('fixtures/fake_hierarchical_data');
|
var fixtures = require('fixtures/fake_hierarchical_data');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var Vis;
|
var Vis;
|
||||||
var Buckets;
|
var Buckets;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var tabifyAggResponse;
|
var tabifyAggResponse;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var Vis;
|
var Vis;
|
||||||
var Table;
|
var Table;
|
||||||
|
@ -14,8 +15,8 @@ define(function (require) {
|
||||||
var ResponseWriter;
|
var ResponseWriter;
|
||||||
|
|
||||||
function defineSetup(stubGetColumns) {
|
function defineSetup(stubGetColumns) {
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
Private = $injector.get('Private');
|
Private = $injector.get('Private');
|
||||||
|
|
||||||
if (stubGetColumns) {
|
if (stubGetColumns) {
|
||||||
|
|
|
@ -2,11 +2,12 @@ define(function (require) {
|
||||||
return ['Table class', function () {
|
return ['Table class', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var Table;
|
var Table;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
Table = Private(require('ui/agg_response/tabify/_table'));
|
Table = Private(require('ui/agg_response/tabify/_table'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@ define(function (require) {
|
||||||
return ['Table Group class', function () {
|
return ['Table Group class', function () {
|
||||||
var TableGroup;
|
var TableGroup;
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
TableGroup = Private(require('ui/agg_response/tabify/_table_group'));
|
TableGroup = Private(require('ui/agg_response/tabify/_table_group'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
return ['AggTableGroup Directive', function () {
|
return ['AggTableGroup Directive', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
var fixtures = require('fixtures/fake_hierarchical_data');
|
var fixtures = require('fixtures/fake_hierarchical_data');
|
||||||
|
|
||||||
|
@ -11,8 +12,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
return ['AggTable Directive', function () {
|
return ['AggTable Directive', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
var fixtures = require('fixtures/fake_hierarchical_data');
|
var fixtures = require('fixtures/fake_hierarchical_data');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
@ -12,8 +13,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
return ['AggParams class', function () {
|
return ['AggParams class', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var AggParams;
|
var AggParams;
|
||||||
|
@ -9,11 +10,11 @@ define(function (require) {
|
||||||
var OptionedAggParam;
|
var OptionedAggParam;
|
||||||
var RegexAggParam;
|
var RegexAggParam;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// stub out the param classes before we get the AggParams
|
// stub out the param classes before we get the AggParams
|
||||||
beforeEach(inject(require('specs/components/agg_types/utils/_stub_agg_params')));
|
beforeEach(ngMock.inject(require('specs/components/agg_types/utils/_stub_agg_params')));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
AggParams = Private(require('ui/agg_types/_agg_params'));
|
AggParams = Private(require('ui/agg_types/_agg_params'));
|
||||||
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
||||||
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
|
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
return ['AggType Class', function () {
|
return ['AggType Class', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var AggType;
|
var AggType;
|
||||||
var AggParams;
|
var AggParams;
|
||||||
|
@ -12,8 +13,8 @@ define(function (require) {
|
||||||
|
|
||||||
require('ui/private');
|
require('ui/private');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
var AggParamsPM = require('ui/agg_types/_agg_params');
|
var AggParamsPM = require('ui/agg_types/_agg_params');
|
||||||
AggParams = sinon.spy(Private(AggParamsPM));
|
AggParams = sinon.spy(Private(AggParamsPM));
|
||||||
Private.stub(AggParamsPM, AggParams);
|
Private.stub(AggParamsPM, AggParams);
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
return ['bucketCountBetween util', function () {
|
return ['bucketCountBetween util', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var Vis;
|
var Vis;
|
||||||
var visTypes;
|
var visTypes;
|
||||||
|
@ -15,8 +16,8 @@ define(function (require) {
|
||||||
return ((n = +n) || 1 / n) < 0;
|
return ((n = +n) || 1 / n) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
visTypes = Private(require('registry/vis_types'));
|
visTypes = Private(require('registry/vis_types'));
|
||||||
|
|
|
@ -2,12 +2,13 @@ define(function (require) {
|
||||||
return ['Histogram Agg', function () {
|
return ['Histogram Agg', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('ordered', function () {
|
describe('ordered', function () {
|
||||||
var histogram;
|
var histogram;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
histogram = Private(require('ui/agg_types/index')).byName.histogram;
|
histogram = Private(require('ui/agg_types/index')).byName.histogram;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -24,8 +25,8 @@ define(function (require) {
|
||||||
describe('params', function () {
|
describe('params', function () {
|
||||||
var paramWriter;
|
var paramWriter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
var AggParamWriter = Private(require('../aggParamWriter'));
|
var AggParamWriter = Private(require('../aggParamWriter'));
|
||||||
paramWriter = new AggParamWriter({ aggType: 'histogram' });
|
paramWriter = new AggParamWriter({ aggType: 'histogram' });
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -5,6 +5,7 @@ define(function (require) {
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var aggResp = require('fixtures/agg_resp/date_histogram');
|
var aggResp = require('fixtures/agg_resp/date_histogram');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var vis;
|
var vis;
|
||||||
|
@ -18,8 +19,8 @@ define(function (require) {
|
||||||
|
|
||||||
var init;
|
var init;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
var Vis = Private(require('ui/vis/vis'));
|
var Vis = Private(require('ui/vis/vis'));
|
||||||
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
var createFilter = Private(require('ui/agg_types/buckets/create_filter/date_histogram'));
|
var createFilter = Private(require('ui/agg_types/buckets/create_filter/date_histogram'));
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('Date range', function () {
|
describe('Date range', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
|
@ -8,8 +10,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('filters', function () {
|
describe('filters', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
|
@ -8,8 +10,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('histogram', function () {
|
describe('histogram', function () {
|
||||||
|
@ -9,8 +10,8 @@ define(function (require) {
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('IP range', function () {
|
describe('IP range', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('range', function () {
|
describe('range', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('terms', function () {
|
describe('terms', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var Vis;
|
var Vis;
|
||||||
var createFilter;
|
var createFilter;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
return ['editor', function () {
|
return ['editor', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
@ -10,8 +11,8 @@ define(function (require) {
|
||||||
var render;
|
var render;
|
||||||
var $scope;
|
var $scope;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector, $compile) {
|
beforeEach(ngMock.inject(function (Private, $injector, $compile) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
||||||
var Vis = Private(require('ui/vis/vis'));
|
var Vis = Private(require('ui/vis/vis'));
|
||||||
|
@ -70,7 +71,7 @@ define(function (require) {
|
||||||
var field;
|
var field;
|
||||||
var interval;
|
var interval;
|
||||||
|
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
field = _.sample(indexPattern.fields);
|
field = _.sample(indexPattern.fields);
|
||||||
interval = _.sample(Private(require('ui/agg_types/buckets/_interval_options')));
|
interval = _.sample(Private(require('ui/agg_types/buckets/_interval_options')));
|
||||||
params = render({ field: field, interval: interval });
|
params = render({ field: field, interval: interval });
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var paramWriter;
|
var paramWriter;
|
||||||
var writeInterval;
|
var writeInterval;
|
||||||
|
@ -12,8 +13,8 @@ define(function (require) {
|
||||||
var setTimeBounds;
|
var setTimeBounds;
|
||||||
var timeField;
|
var timeField;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
var AggParamWriter = Private(require('../../aggParamWriter'));
|
var AggParamWriter = Private(require('../../aggParamWriter'));
|
||||||
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
var timefilter = $injector.get('timefilter');
|
var timefilter = $injector.get('timefilter');
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
var simulateKeys = require('testUtils/simulateKeys');
|
var simulateKeys = require('testUtils/simulateKeys');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/number_list/number_list');
|
require('ui/number_list/number_list');
|
||||||
|
|
||||||
|
@ -18,8 +19,8 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
var $compile = $injector.get('$compile');
|
var $compile = $injector.get('$compile');
|
||||||
var $rootScope = $injector.get('$rootScope');
|
var $rootScope = $injector.get('$rootScope');
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('AggTypesComponent', function () {
|
describe('AggTypesComponent', function () {
|
||||||
describe(require('specs/components/agg_types/_agg_type'));
|
describe(require('specs/components/agg_types/_agg_type'));
|
||||||
|
@ -11,8 +12,8 @@ define(function (require) {
|
||||||
var bucketAggs;
|
var bucketAggs;
|
||||||
var BucketAggType;
|
var BucketAggType;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
bucketAggs = Private(require('ui/agg_types/index')).byType.buckets;
|
bucketAggs = Private(require('ui/agg_types/index')).byType.buckets;
|
||||||
BucketAggType = Private(require('ui/agg_types/buckets/_bucket_agg_type'));
|
BucketAggType = Private(require('ui/agg_types/buckets/_bucket_agg_type'));
|
||||||
}));
|
}));
|
||||||
|
@ -28,8 +29,8 @@ define(function (require) {
|
||||||
var metricAggs;
|
var metricAggs;
|
||||||
var MetricAggType;
|
var MetricAggType;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
metricAggs = Private(require('ui/agg_types/index')).byType.metrics;
|
metricAggs = Private(require('ui/agg_types/index')).byType.metrics;
|
||||||
MetricAggType = Private(require('ui/agg_types/metrics/_metric_agg_type'));
|
MetricAggType = Private(require('ui/agg_types/metrics/_metric_agg_type'));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('calculateInterval()', function () {
|
describe('calculateInterval()', function () {
|
||||||
var AggConfig;
|
var AggConfig;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
@ -8,8 +10,8 @@ define(function (require) {
|
||||||
var createFilter;
|
var createFilter;
|
||||||
var calculateInterval;
|
var calculateInterval;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
AggConfig = Private(require('ui/vis/AggConfig'));
|
AggConfig = Private(require('ui/vis/AggConfig'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
|
@ -2,13 +2,14 @@ define(function (require) {
|
||||||
return ['Field', function () {
|
return ['Field', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var BaseAggParam;
|
var BaseAggParam;
|
||||||
var FieldAggParam;
|
var FieldAggParam;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
||||||
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
|
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -2,13 +2,14 @@ define(function (require) {
|
||||||
return ['Optioned', function () {
|
return ['Optioned', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var BaseAggParam;
|
var BaseAggParam;
|
||||||
var OptionedAggParam;
|
var OptionedAggParam;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
||||||
OptionedAggParam = Private(require('ui/agg_types/param_types/optioned'));
|
OptionedAggParam = Private(require('ui/agg_types/param_types/optioned'));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
|
|
||||||
return ['JSON', function () {
|
return ['JSON', function () {
|
||||||
|
@ -21,10 +22,10 @@ define(function (require) {
|
||||||
aggParam = new JsonAggParam(_.defaults(config, defaults));
|
aggParam = new JsonAggParam(_.defaults(config, defaults));
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
aggConfig = { params: {} };
|
aggConfig = { params: {} };
|
||||||
output = { params: {} };
|
output = { params: {} };
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,16 @@ define(function (require) {
|
||||||
return ['Regex', function () {
|
return ['Regex', function () {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var BaseAggParam;
|
var BaseAggParam;
|
||||||
var RegexAggParam;
|
var RegexAggParam;
|
||||||
var Vis;
|
var Vis;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
||||||
RegexAggParam = Private(require('ui/agg_types/param_types/regex'));
|
RegexAggParam = Private(require('ui/agg_types/param_types/regex'));
|
||||||
Vis = Private(require('ui/vis/vis'));
|
Vis = Private(require('ui/vis/vis'));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
return ['String', function () {
|
return ['String', function () {
|
||||||
var paramName = 'json_test';
|
var paramName = 'json_test';
|
||||||
|
@ -20,10 +21,10 @@ define(function (require) {
|
||||||
aggParam = new StringAggParam(_.defaults(config, defaults));
|
aggParam = new StringAggParam(_.defaults(config, defaults));
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
// fetch our deps
|
// fetch our deps
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
|
||||||
StringAggParam = Private(require('ui/agg_types/param_types/string'));
|
StringAggParam = Private(require('ui/agg_types/param_types/string'));
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@ define(function (require) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stub all of the param classes, but ensure that they still inherit properly.
|
* stub all of the param classes, but ensure that they still inherit properly.
|
||||||
* This method should be passed directly to inject();
|
* This method should be passed directly to ngMock.inject();
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* var stubParamClasses = require('specs/components/agg_types/utils/_stub_agg_params');
|
* var stubParamClasses = require('specs/components/agg_types/utils/_stub_agg_params');
|
||||||
* describe('something', function () {
|
* describe('something', function () {
|
||||||
* beforeEach(inject(stubParamClasses));
|
* beforeEach(ngMock.inject(stubParamClasses));
|
||||||
* })
|
* })
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param {PrivateLoader} Private - The private module loader, inject by passing this function to inject()
|
* @param {PrivateLoader} Private - The private module loader, inject by passing this function to ngMock.inject()
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
return function stubParamClasses(Private) {
|
return function stubParamClasses(Private) {
|
||||||
|
|
|
@ -2,12 +2,13 @@ define(function (require) {
|
||||||
describe('$scope.$bind', function () {
|
describe('$scope.$bind', function () {
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var $rootScope;
|
var $rootScope;
|
||||||
var $scope;
|
var $scope;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -202,14 +202,8 @@ define(function (require) {
|
||||||
return tab ? tab.id : def;
|
return tab ? tab.id : def;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
chrome.setupAngular = function (moduleDeps) {
|
||||||
* Get the id of the active tab
|
var kibana = modules.get('kibana', moduleDeps);
|
||||||
*
|
|
||||||
* @param {*} def - the default value if there isn't any active tab
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
chrome.bootstrap = function (angularModules) {
|
|
||||||
var kibana = modules.get('kibana', angularModules);
|
|
||||||
|
|
||||||
kibana
|
kibana
|
||||||
.constant('kbnVersion', payload.version)
|
.constant('kbnVersion', payload.version)
|
||||||
|
@ -227,6 +221,16 @@ define(function (require) {
|
||||||
.constant('sessionId', Date.now());
|
.constant('sessionId', Date.now());
|
||||||
|
|
||||||
modules.link(kibana);
|
modules.link(kibana);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the id of the active tab
|
||||||
|
*
|
||||||
|
* @param {*} def - the default value if there isn't any active tab
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
chrome.bootstrap = function (angularModules) {
|
||||||
|
chrome.setupAngular(angularModules);
|
||||||
angular.bootstrap(document, ['kibana']);
|
angular.bootstrap(document, ['kibana']);
|
||||||
$(document.body).children(':not(style-compile)').show();
|
$(document.body).children(':not(style-compile)').show();
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/clipboard/clipboard');
|
require('ui/clipboard/clipboard');
|
||||||
|
|
||||||
|
@ -17,9 +18,9 @@ define(function (require) {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// load the application
|
// load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
inject(function (_$rootScope_, _$compile_, _$interpolate_) {
|
ngMock.inject(function (_$rootScope_, _$compile_, _$interpolate_) {
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$interpolate = _$interpolate_;
|
$interpolate = _$interpolate_;
|
||||||
|
|
|
@ -4,9 +4,10 @@ define(function (require) {
|
||||||
var config;
|
var config;
|
||||||
var defaults;
|
var defaults;
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
config = $injector.get('config');
|
config = $injector.get('config');
|
||||||
$scope = $injector.get('$rootScope');
|
$scope = $injector.get('$rootScope');
|
||||||
defaults = Private(require('ui/config/defaults'));
|
defaults = Private(require('ui/config/defaults'));
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('Query decorator', function () {
|
describe('Query decorator', function () {
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
@ -8,9 +10,9 @@ define(function (require) {
|
||||||
|
|
||||||
var indexPattern, getComputedFields, fn;
|
var indexPattern, getComputedFields, fn;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
module('kibana', function ($provide) {
|
ngMock.module('kibana', function ($provide) {
|
||||||
|
|
||||||
// Super simple config stub
|
// Super simple config stub
|
||||||
$provide.service('config', function () {
|
$provide.service('config', function () {
|
||||||
|
@ -23,7 +25,7 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(inject(function (Private, $injector, _config_) {
|
beforeEach(ngMock.inject(function (Private, $injector, _config_) {
|
||||||
config = _config_;
|
config = _config_;
|
||||||
fn = Private(require('ui/courier/data_source/_decorate_query'));
|
fn = Private(require('ui/courier/data_source/_decorate_query'));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -2,14 +2,15 @@ define(function (require) {
|
||||||
describe('SearchSource#normalizeSortRequest', function () {
|
describe('SearchSource#normalizeSortRequest', function () {
|
||||||
require('ui/private');
|
require('ui/private');
|
||||||
require('angular').module('normalizeSortRequest', ['kibana']);
|
require('angular').module('normalizeSortRequest', ['kibana']);
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var normalizeSortRequest;
|
var normalizeSortRequest;
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
var normalizedSort;
|
var normalizedSort;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
normalizeSortRequest = Private(require('ui/courier/data_source/_normalize_sort_request'));
|
normalizeSortRequest = Private(require('ui/courier/data_source/_normalize_sort_request'));
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
describe('Courier DocFetchRequest class', function () {
|
describe('Courier DocFetchRequest class', function () {
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var storage;
|
var storage;
|
||||||
var source;
|
var source;
|
||||||
|
@ -10,8 +11,8 @@ define(function (require) {
|
||||||
|
|
||||||
var setVersion;
|
var setVersion;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (Private, Promise, $injector) {
|
beforeEach(ngMock.inject(function (Private, Promise, $injector) {
|
||||||
var DocSource = Private(require('ui/courier/data_source/doc_source'));
|
var DocSource = Private(require('ui/courier/data_source/doc_source'));
|
||||||
var DocFetchRequest = Private(require('ui/courier/fetch/request/doc'));
|
var DocFetchRequest = Private(require('ui/courier/fetch/request/doc'));
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
var debounce;
|
var debounce;
|
||||||
var $timeout;
|
var $timeout;
|
||||||
var $timeoutSpy;
|
var $timeoutSpy;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
inject(function ($injector, _$timeout_) {
|
ngMock.inject(function ($injector, _$timeout_) {
|
||||||
$timeout = _$timeout_;
|
$timeout = _$timeout_;
|
||||||
$timeoutSpy = sinon.spy($timeout);
|
$timeoutSpy = sinon.spy($timeout);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/directives/auto_select_if_only_one');
|
require('ui/directives/auto_select_if_only_one');
|
||||||
|
|
||||||
describe('Auto-select if only one directive', function () {
|
describe('Auto-select if only one directive', function () {
|
||||||
|
@ -10,9 +11,9 @@ define(function (require) {
|
||||||
var oneOption = [{label: 'foo'}];
|
var oneOption = [{label: 'foo'}];
|
||||||
var multiOptions = [{label: 'foo'}, {label: 'bar'}];
|
var multiOptions = [{label: 'foo'}, {label: 'bar'}];
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
$compile(html)($rootScope);
|
$compile(html)($rootScope);
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var sinon = require('sinon');
|
var sinon = require('sinon');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/directives/confirm_click');
|
require('ui/directives/confirm_click');
|
||||||
|
|
||||||
|
@ -15,10 +16,10 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function (text) {
|
var init = function (text) {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
|
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('angular-route');
|
require('angular-route');
|
||||||
require('plugins/kibana/discover/index');
|
require('plugins/kibana/discover/index');
|
||||||
|
@ -10,10 +11,10 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function (expandable) {
|
var init = function (expandable) {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
|
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
require('ui/fixedScroll');
|
require('ui/fixedScroll');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
describe('FixedScroll directive', function () {
|
describe('FixedScroll directive', function () {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
@ -10,8 +11,8 @@ define(function (require) {
|
||||||
var compile;
|
var compile;
|
||||||
var trash = [];
|
var trash = [];
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($compile, $rootScope) {
|
beforeEach(ngMock.inject(function ($compile, $rootScope) {
|
||||||
|
|
||||||
compile = function (ratioY, ratioX) {
|
compile = function (ratioY, ratioX) {
|
||||||
if (ratioX == null) ratioX = ratioY;
|
if (ratioX == null) ratioX = ratioY;
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/directives/inequality');
|
require('ui/directives/inequality');
|
||||||
|
|
||||||
describe('greater_than model validator directive', function () {
|
describe('greater_than model validator directive', function () {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html;
|
var html;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/directives/input_focus');
|
require('ui/directives/input_focus');
|
||||||
|
|
||||||
describe('Input focus directive', function () {
|
describe('Input focus directive', function () {
|
||||||
|
@ -9,8 +10,8 @@ define(function (require) {
|
||||||
var $el, selectedEl, selectedText;
|
var $el, selectedEl, selectedText;
|
||||||
var inputValue = 'Input Text Value';
|
var inputValue = 'Input Text Value';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_, _$timeout_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_, _$timeout_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
$timeout = _$timeout_;
|
$timeout = _$timeout_;
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/directives/input_whole_number');
|
require('ui/directives/input_whole_number');
|
||||||
|
|
||||||
describe('Whole number input directive', function () {
|
describe('Whole number input directive', function () {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" input-whole-number />';
|
var html = '<input type="text" ng-model="value" input-whole-number />';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('angular-route');
|
require('angular-route');
|
||||||
|
@ -12,10 +13,10 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
|
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
|
|
@ -5,6 +5,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
@ -22,13 +23,13 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Stub out the clock so 'now' doesn't move
|
// Stub out the clock so 'now' doesn't move
|
||||||
clock = sinon.useFakeTimers(moment(anchor).valueOf());
|
clock = sinon.useFakeTimers(moment(anchor).valueOf());
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
|
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
@ -88,7 +89,7 @@ define(function (require) {
|
||||||
var $courier;
|
var $courier;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
inject(function (courier, $rootScope) {
|
ngMock.inject(function (courier, $rootScope) {
|
||||||
$courier = courier;
|
$courier = courier;
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('angular-route');
|
require('angular-route');
|
||||||
|
@ -12,10 +13,10 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function (text) {
|
var init = function (text) {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
|
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var sinon = require('sinon');
|
var sinon = require('sinon');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('angular-route');
|
require('angular-route');
|
||||||
|
@ -25,9 +26,9 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
module('kibana/typeahead', function ($provide) {
|
ngMock.module('kibana/typeahead', function ($provide) {
|
||||||
$provide.factory('PersistedLog', function () {
|
$provide.factory('PersistedLog', function () {
|
||||||
function PersistedLogMock(name, options) {
|
function PersistedLogMock(name, options) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -47,7 +48,7 @@ define(function (require) {
|
||||||
|
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($injector, $controller, $rootScope, $compile) {
|
ngMock.inject(function ($injector, $controller, $rootScope, $compile) {
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/directives/validate_cidr_mask');
|
require('ui/directives/validate_cidr_mask');
|
||||||
|
|
||||||
describe('Validate CIDR mask directive', function () {
|
describe('Validate CIDR mask directive', function () {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-cidr-mask />';
|
var html = '<input type="text" ng-model="value" validate-cidr-mask />';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/directives/validate_date_math');
|
require('ui/directives/validate_date_math');
|
||||||
|
|
||||||
describe('Validate date math directive', function () {
|
describe('Validate date math directive', function () {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-date-math />';
|
var html = '<input type="text" ng-model="value" validate-date-math />';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('ui/directives/validate_index_name');
|
require('ui/directives/validate_index_name');
|
||||||
|
@ -9,9 +10,9 @@ define(function (require) {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html = '<input type="text" ng-model="indexName" validate-index-name />';
|
var html = '<input type="text" ng-model="indexName" validate-index-name />';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
require('ui/directives/validate_ip');
|
require('ui/directives/validate_ip');
|
||||||
|
|
||||||
describe('Validate IP directive', function () {
|
describe('Validate IP directive', function () {
|
||||||
var $compile, $rootScope;
|
var $compile, $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-ip />';
|
var html = '<input type="text" ng-model="value" validate-ip />';
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('ui/directives/validate_json');
|
require('ui/directives/validate_json');
|
||||||
|
@ -22,12 +23,12 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function (type) {
|
var init = function (type) {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
type = type || 'input';
|
type = type || 'input';
|
||||||
var elMarkup = markup[type];
|
var elMarkup = markup[type];
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($injector, $rootScope, $compile) {
|
ngMock.inject(function ($injector, $rootScope, $compile) {
|
||||||
// Give us a scope
|
// Give us a scope
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
$parentScope.mockModel = mockScope;
|
$parentScope.mockModel = mockScope;
|
||||||
|
|
|
@ -2,6 +2,7 @@ define(function (require) {
|
||||||
var angular = require('angular');
|
var angular = require('angular');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('ui/validate_query/validate_query');
|
require('ui/validate_query/validate_query');
|
||||||
|
@ -37,9 +38,9 @@ define(function (require) {
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
// Load the application
|
// Load the application
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
module('kibana', function ($provide) {
|
ngMock.module('kibana', function ($provide) {
|
||||||
$provide.service('es', function () {
|
$provide.service('es', function () {
|
||||||
return { indices: { validateQuery: function () {} } };
|
return { indices: { validateQuery: function () {} } };
|
||||||
});
|
});
|
||||||
|
@ -57,7 +58,7 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create the scope
|
// Create the scope
|
||||||
inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _Promise_, _Private_, _config_) {
|
ngMock.inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _Promise_, _Private_, _config_) {
|
||||||
$timeout = _$timeout_;
|
$timeout = _$timeout_;
|
||||||
$compile = _$compile_;
|
$compile = _$compile_;
|
||||||
Promise = _Promise_;
|
Promise = _Promise_;
|
||||||
|
|
|
@ -5,6 +5,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var searchResponse = require('fixtures/search_response');
|
var searchResponse = require('fixtures/search_response');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
require('ui/private');
|
require('ui/private');
|
||||||
|
@ -14,7 +15,7 @@ define(function (require) {
|
||||||
var $parentScope, $scope, $timeout, searchSource;
|
var $parentScope, $scope, $timeout, searchSource;
|
||||||
|
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
inject(function ($rootScope, $compile, _$timeout_) {
|
ngMock.inject(function ($rootScope, $compile, _$timeout_) {
|
||||||
$timeout = _$timeout_;
|
$timeout = _$timeout_;
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
_.assign($parentScope, props);
|
_.assign($parentScope, props);
|
||||||
|
@ -39,10 +40,10 @@ define(function (require) {
|
||||||
describe('docTable', function () {
|
describe('docTable', function () {
|
||||||
var $elem;
|
var $elem;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$elem = angular.element('<doc-table search-source="searchSource" columns="columns" sorting="sorting"></doc-table>');
|
$elem = angular.element('<doc-table search-source="searchSource" columns="columns" sorting="sorting"></doc-table>');
|
||||||
inject(function (Private) {
|
ngMock.inject(function (Private) {
|
||||||
searchSource = Private(require('fixtures/stubbed_search_source'));
|
searchSource = Private(require('fixtures/stubbed_search_source'));
|
||||||
});
|
});
|
||||||
init($elem, {
|
init($elem, {
|
||||||
|
|
|
@ -2,12 +2,13 @@ define(function (require) {
|
||||||
var getSort = require('ui/doc_table/lib/get_sort');
|
var getSort = require('ui/doc_table/lib/get_sort');
|
||||||
var defaultSort = {time: 'desc'};
|
var defaultSort = {time: 'desc'};
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var indexPattern;
|
var indexPattern;
|
||||||
|
|
||||||
describe('docTable', function () {
|
describe('docTable', function () {
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(inject(function (Private, _$rootScope_, Promise) {
|
beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var getFakeRow = require('fixtures/fake_row');
|
var getFakeRow = require('fixtures/fake_row');
|
||||||
|
|
||||||
describe('Doc Table', function () {
|
describe('Doc Table', function () {
|
||||||
|
@ -18,8 +19,8 @@ define(function (require) {
|
||||||
// Stub out a minimal mapping of 4 fields
|
// Stub out a minimal mapping of 4 fields
|
||||||
var mapping;
|
var mapping;
|
||||||
|
|
||||||
beforeEach(module('kibana', 'apps/discover'));
|
beforeEach(ngMock.module('kibana', 'apps/discover'));
|
||||||
beforeEach(inject(function (_config_, $rootScope, Private) {
|
beforeEach(ngMock.inject(function (_config_, $rootScope, Private) {
|
||||||
config = _config_;
|
config = _config_;
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
$parentScope.indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
$parentScope.indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
|
@ -28,7 +29,7 @@ define(function (require) {
|
||||||
|
|
||||||
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
|
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
inject(function ($compile) {
|
ngMock.inject(function ($compile) {
|
||||||
_.assign($parentScope, props);
|
_.assign($parentScope, props);
|
||||||
$compile($elem)($parentScope);
|
$compile($elem)($parentScope);
|
||||||
$elem.scope().$digest();
|
$elem.scope().$digest();
|
||||||
|
@ -316,7 +317,7 @@ define(function (require) {
|
||||||
var $root;
|
var $root;
|
||||||
var $before;
|
var $before;
|
||||||
|
|
||||||
beforeEach(inject(function ($rootScope, $compile, Private) {
|
beforeEach(ngMock.inject(function ($rootScope, $compile, Private) {
|
||||||
$root = $rootScope;
|
$root = $rootScope;
|
||||||
$root.row = getFakeRow(0, mapping);
|
$root.row = getFakeRow(0, mapping);
|
||||||
$root.columns = ['_source'];
|
$root.columns = ['_source'];
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var initialDocTitle;
|
var initialDocTitle;
|
||||||
var MAIN_TITLE = 'Kibana 4';
|
var MAIN_TITLE = 'Kibana 4';
|
||||||
var fakeApp = { name: 'fancy pants' };
|
var fakeApp = { name: 'fancy pants' };
|
||||||
|
@ -18,12 +19,12 @@ define(function (require) {
|
||||||
document.title = initialDocTitle;
|
document.title = initialDocTitle;
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(module('kibana', function ($provide) {
|
beforeEach(ngMock.module('kibana', function ($provide) {
|
||||||
$provide.decorator('docTitle', decorateWithSpy('update'));
|
$provide.decorator('docTitle', decorateWithSpy('update'));
|
||||||
$provide.decorator('$rootScope', decorateWithSpy('$on'));
|
$provide.decorator('$rootScope', decorateWithSpy('$on'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
if (_.random(0, 1)) {
|
if (_.random(0, 1)) {
|
||||||
docTitle = $injector.get('docTitle');
|
docTitle = $injector.get('docTitle');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,6 +4,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var hit = {
|
var hit = {
|
||||||
'_index': 'logstash-2014.09.09',
|
'_index': 'logstash-2014.09.09',
|
||||||
'_type': 'apache',
|
'_type': 'apache',
|
||||||
|
@ -27,7 +28,7 @@ define(function (require) {
|
||||||
var $parentScope, $scope, indexPattern, flattened;
|
var $parentScope, $scope, indexPattern, flattened;
|
||||||
|
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
inject(function ($rootScope, $compile) {
|
ngMock.inject(function ($rootScope, $compile) {
|
||||||
$parentScope = $rootScope;
|
$parentScope = $rootScope;
|
||||||
_.assign($parentScope, props);
|
_.assign($parentScope, props);
|
||||||
$compile($elem)($parentScope);
|
$compile($elem)($parentScope);
|
||||||
|
@ -44,10 +45,10 @@ define(function (require) {
|
||||||
describe('docViewer', function () {
|
describe('docViewer', function () {
|
||||||
var $elem;
|
var $elem;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$elem = angular.element('<doc-viewer index-pattern="indexPattern" hit="hit" filter="filter"></doc-viewer>');
|
$elem = angular.element('<doc-viewer index-pattern="indexPattern" hit="hit" filter="filter"></doc-viewer>');
|
||||||
inject(function (Private) {
|
ngMock.inject(function (Private) {
|
||||||
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
|
||||||
flattened = indexPattern.flattenHit(hit);
|
flattened = indexPattern.flattenHit(hit);
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('sinon');
|
var sinon = require('sinon');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/private');
|
require('ui/private');
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,9 +11,9 @@ define(function (require) {
|
||||||
var $rootScope;
|
var $rootScope;
|
||||||
var BaseObject;
|
var BaseObject;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
inject(function (_$rootScope_, Private) {
|
ngMock.inject(function (_$rootScope_, Private) {
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
BaseObject = require('utils/BaseObject');
|
BaseObject = require('utils/BaseObject');
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
require('ui/private');
|
require('ui/private');
|
||||||
|
|
||||||
describe('Events', function () {
|
describe('Events', function () {
|
||||||
|
@ -14,9 +15,9 @@ define(function (require) {
|
||||||
var Promise;
|
var Promise;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
module('kibana');
|
ngMock.module('kibana');
|
||||||
|
|
||||||
inject(function ($injector, Private) {
|
ngMock.inject(function ($injector, Private) {
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
Notifier = $injector.get('Notifier');
|
Notifier = $injector.get('Notifier');
|
||||||
Promise = $injector.get('Promise');
|
Promise = $injector.get('Promise');
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
describe('fancy forms', function () {
|
describe('fancy forms', function () {
|
||||||
|
@ -16,8 +17,8 @@ define(function (require) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
$compile = $injector.get('$compile');
|
$compile = $injector.get('$compile');
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define(function (require) {
|
define(function (require) {
|
||||||
describe('FieldEditor directive', function () {
|
describe('FieldEditor directive', function () {
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
|
||||||
var Field;
|
var Field;
|
||||||
|
@ -11,8 +12,8 @@ define(function (require) {
|
||||||
var $scope;
|
var $scope;
|
||||||
var $el;
|
var $el;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(inject(function ($compile, $injector, Private) {
|
beforeEach(ngMock.inject(function ($compile, $injector, Private) {
|
||||||
$rootScope = $injector.get('$rootScope');
|
$rootScope = $injector.get('$rootScope');
|
||||||
Field = Private(require('ui/index_patterns/_field'));
|
Field = Private(require('ui/index_patterns/_field'));
|
||||||
StringFormat = Private(require('registry/field_formats')).getType('string');
|
StringFormat = Private(require('registry/field_formats')).getType('string');
|
||||||
|
|
|
@ -3,6 +3,7 @@ define(function (require) {
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var sinon = require('auto-release-sinon/mocha');
|
var sinon = require('auto-release-sinon/mocha');
|
||||||
var expect = require('expect.js');
|
var expect = require('expect.js');
|
||||||
|
var ngMock = require('ngMock');
|
||||||
var MockState = require('fixtures/mock_state');
|
var MockState = require('fixtures/mock_state');
|
||||||
var storeNames = {
|
var storeNames = {
|
||||||
app: 'appState',
|
app: 'appState',
|
||||||
|
@ -12,7 +13,7 @@ define(function (require) {
|
||||||
var queryFilter;
|
var queryFilter;
|
||||||
var $rootScope, appState, globalState;
|
var $rootScope, appState, globalState;
|
||||||
|
|
||||||
beforeEach(module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
appState = new MockState({ filters: [] });
|
appState = new MockState({ filters: [] });
|
||||||
|
@ -35,11 +36,11 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
module('kibana/courier', function ($provide) {
|
ngMock.module('kibana/courier', function ($provide) {
|
||||||
$provide.service('courier', require('fixtures/mock_courier'));
|
$provide.service('courier', require('fixtures/mock_courier'));
|
||||||
});
|
});
|
||||||
|
|
||||||
module('kibana/global_state', function ($provide) {
|
ngMock.module('kibana/global_state', function ($provide) {
|
||||||
$provide.service('getAppState', function () {
|
$provide.service('getAppState', function () {
|
||||||
return function () {
|
return function () {
|
||||||
return appState;
|
return appState;
|
||||||
|
@ -53,7 +54,7 @@ define(function (require) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
inject(function (_$rootScope_, Private) {
|
ngMock.inject(function (_$rootScope_, Private) {
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
queryFilter = Private(require('ui/filter_bar/query_filter'));
|
queryFilter = Private(require('ui/filter_bar/query_filter'));
|
||||||
});
|
});
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue