elasticsearch-queryctrl-specs.js 802 B

1234567891011121314151617181920212223242526272829303132
  1. define([
  2. './helpers',
  3. 'app/plugins/datasource/elasticsearch/queryCtrl',
  4. 'app/services/uiSegmentSrv'
  5. ], function(helpers) {
  6. 'use strict';
  7. describe('ElasticQueryCtrl', function() {
  8. var ctx = new helpers.ControllerTestContext();
  9. beforeEach(module('grafana.controllers'));
  10. beforeEach(module('grafana.services'));
  11. beforeEach(ctx.providePhase());
  12. beforeEach(ctx.createControllerPhase('ElasticQueryCtrl'));
  13. beforeEach(function() {
  14. ctx.scope.target = {};
  15. ctx.scope.$parent = { get_data: sinon.spy() };
  16. ctx.scope.datasource = ctx.datasource;
  17. ctx.scope.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
  18. });
  19. describe('init', function() {
  20. beforeEach(function() {
  21. ctx.scope.init();
  22. });
  23. });
  24. });
  25. });