query_ctrl_specs.ts 936 B

1234567891011121314151617181920212223242526272829
  1. ///<amd-dependency path="../query_ctrl" />
  2. ///<amd-dependency path="app/core/services/segment_srv" />
  3. ///<amd-dependency path="test/specs/helpers" name="helpers" />
  4. import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
  5. import helpers from 'test/specs/helpers';
  6. describe('ElasticQueryCtrl', function() {
  7. var ctx = new helpers.ControllerTestContext();
  8. beforeEach(angularMocks.module('grafana.controllers'));
  9. beforeEach(angularMocks.module('grafana.services'));
  10. beforeEach(ctx.providePhase());
  11. beforeEach(ctx.createControllerPhase('ElasticQueryCtrl'));
  12. beforeEach(function() {
  13. ctx.scope.target = {};
  14. ctx.scope.$parent = { get_data: sinon.spy() };
  15. ctx.scope.datasource = ctx.datasource;
  16. ctx.scope.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
  17. });
  18. describe('init', function() {
  19. beforeEach(function() {
  20. ctx.scope.init();
  21. });
  22. });
  23. });