tech(): fixed broken tests due to angularjs upgrade

pull/4491/head
Torkel Ödegaard 10 years ago
parent 70b66382eb
commit 82ad5a632d
  1. 1
      public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts
  2. 2
      public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts
  3. 1
      public/app/plugins/datasource/graphite/specs/datasource_specs.ts
  4. 3
      public/app/plugins/datasource/opentsdb/specs/datasource-specs.ts
  5. 1
      public/app/plugins/datasource/prometheus/specs/datasource_specs.ts
  6. 2
      public/app/plugins/datasource/prometheus/specs/metric_find_query_specs.ts
  7. 3
      public/test/specs/value_select_dropdown_specs.js

@ -21,6 +21,7 @@ describe('CloudWatchDatasource', function() {
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.ds = $injector.instantiate(CloudWatchDatasource, {instanceSettings: instanceSettings}); ctx.ds = $injector.instantiate(CloudWatchDatasource, {instanceSettings: instanceSettings});
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
describe('When performing CloudWatch query', function() { describe('When performing CloudWatch query', function() {

@ -12,11 +12,13 @@ describe('ElasticDatasource', function() {
beforeEach(angularMocks.module('grafana.core')); beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.services')); beforeEach(angularMocks.module('grafana.services'));
beforeEach(ctx.providePhase(['templateSrv', 'backendSrv'])); beforeEach(ctx.providePhase(['templateSrv', 'backendSrv']));
beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) { beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) {
ctx.$q = $q; ctx.$q = $q;
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.$injector = $injector; ctx.$injector = $injector;
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
function createDatasource(instanceSettings) { function createDatasource(instanceSettings) {

@ -15,6 +15,7 @@ describe('graphiteDatasource', function() {
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.$injector = $injector; ctx.$injector = $injector;
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
beforeEach(function() { beforeEach(function() {

@ -12,9 +12,10 @@ describe('opentsdb', function() {
beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) { beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) {
ctx.$q = $q; ctx.$q = $q;
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.ds = $injector.instantiate(OpenTsDatasource, {instanceSettings: instanceSettings}); ctx.ds = $injector.instantiate(OpenTsDatasource, {instanceSettings: instanceSettings});
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
describe('When performing metricFindQuery', function() { describe('When performing metricFindQuery', function() {

@ -14,6 +14,7 @@ describe('PrometheusDatasource', function() {
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.ds = $injector.instantiate(PrometheusDatasource, {instanceSettings: instanceSettings}); ctx.ds = $injector.instantiate(PrometheusDatasource, {instanceSettings: instanceSettings});
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
describe('When querying prometheus with one target using query editor target spec', function() { describe('When querying prometheus with one target using query editor target spec', function() {

@ -8,6 +8,7 @@ describe('PrometheusMetricFindQuery', function() {
var ctx = new helpers.ServiceTestContext(); var ctx = new helpers.ServiceTestContext();
var instanceSettings = {url: 'proxied', directUrl: 'direct', user: 'test', password: 'mupp' }; var instanceSettings = {url: 'proxied', directUrl: 'direct', user: 'test', password: 'mupp' };
beforeEach(angularMocks.module('grafana.core')); beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.services')); beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) { beforeEach(angularMocks.inject(function($q, $rootScope, $httpBackend, $injector) {
@ -15,6 +16,7 @@ describe('PrometheusMetricFindQuery', function() {
ctx.$httpBackend = $httpBackend; ctx.$httpBackend = $httpBackend;
ctx.$rootScope = $rootScope; ctx.$rootScope = $rootScope;
ctx.ds = $injector.instantiate(PrometheusDatasource, {instanceSettings: instanceSettings}); ctx.ds = $injector.instantiate(PrometheusDatasource, {instanceSettings: instanceSettings});
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
describe('When performing metricFindQuery', function() { describe('When performing metricFindQuery', function() {

@ -11,7 +11,7 @@ function () {
var rootScope; var rootScope;
beforeEach(module('grafana.core')); beforeEach(module('grafana.core'));
beforeEach(inject(function($controller, $rootScope, $q) { beforeEach(inject(function($controller, $rootScope, $q, $httpBackend) {
rootScope = $rootScope; rootScope = $rootScope;
scope = $rootScope.$new(); scope = $rootScope.$new();
ctrl = $controller('ValueSelectDropdownCtrl', {$scope: scope}); ctrl = $controller('ValueSelectDropdownCtrl', {$scope: scope});
@ -19,6 +19,7 @@ function () {
return $q.when(tagValuesMap[obj.tagKey]); return $q.when(tagValuesMap[obj.tagKey]);
}; };
ctrl.onUpdated = sinon.spy(); ctrl.onUpdated = sinon.spy();
$httpBackend.when('GET', /\.html$/).respond('');
})); }));
describe("Given simple variable", function() { describe("Given simple variable", function() {

Loading…
Cancel
Save