Commit 0683742e by Torkel Ödegaard

tech(library upgrade): fixed unit test broken by angularjs upgrade, #7274

parent 6f87f886
......@@ -12,6 +12,9 @@ describe('VariableSrv init', function() {
beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.controllers'));
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase(['datasourceSrv', 'timeSrv', 'templateSrv', '$location']));
beforeEach(angularMocks.inject(($rootScope, $q, $location, $injector) => {
......
......@@ -13,6 +13,9 @@ describe('GraphiteQueryCtrl', function() {
beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.controllers'));
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase());
beforeEach(angularMocks.inject(($rootScope, $controller, $q) => {
......
......@@ -10,6 +10,9 @@ describe('InfluxDBQueryCtrl', function() {
beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.controllers'));
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase());
beforeEach(angularMocks.inject(($rootScope, $controller, $q) => {
......
......@@ -7,6 +7,10 @@ describe('OpenTsQueryCtrl', function() {
beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase(['backendSrv','templateSrv']));
beforeEach(ctx.providePhase());
......
......@@ -12,6 +12,9 @@ describe('GraphCtrl', function() {
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module('grafana.controllers'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase());
beforeEach(ctx.createPanelController(GraphCtrl));
......
......@@ -17,6 +17,9 @@ describe('SingleStatCtrl', function() {
beforeEach(angularMocks.module('grafana.services'));
beforeEach(angularMocks.module('grafana.controllers'));
beforeEach(angularMocks.module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase());
beforeEach(ctx.createPanelController(SingleStatCtrl));
......
......@@ -162,6 +162,7 @@ define([
this.fillVariableValuesForUrl = function() {};
this.updateTemplateData = function() { };
this.variableExists = function() { return false; };
this.variableInitialized = function() { };
this.highlightVariablesAsHtml = function(str) { return str; };
this.setGrafanaVariable = function(name, value) {
this.data[name] = value;
......
......@@ -16,6 +16,9 @@ define([
beforeEach(module('grafana.controllers'));
beforeEach(module('grafana.services'));
beforeEach(module(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
}));
beforeEach(ctx.providePhase());
......@@ -28,7 +31,7 @@ define([
ctx.scope.panel = { id: 22 };
ctx.scope.init();
expect(ctx.scope.shareUrl).to.be('http://server/#/test?from=1000&to=2000&panelId=22&fullscreen');
expect(ctx.scope.shareUrl).to.be('http://server/#!/test?from=1000&to=2000&panelId=22&fullscreen');
});
it('should generate render url', function() {
......@@ -48,7 +51,7 @@ define([
ctx.scope.panel = null;
ctx.scope.init();
expect(ctx.scope.shareUrl).to.be('http://server/#/test?from=1000&to=2000');
expect(ctx.scope.shareUrl).to.be('http://server/#!/test?from=1000&to=2000');
});
it('should add theme when specified', function() {
......@@ -57,7 +60,7 @@ define([
ctx.scope.panel = null;
ctx.scope.init();
expect(ctx.scope.shareUrl).to.be('http://server/#/test?from=1000&to=2000&theme=light');
expect(ctx.scope.shareUrl).to.be('http://server/#!/test?from=1000&to=2000&theme=light');
});
it('should include template variables in url', function() {
......@@ -70,7 +73,7 @@ define([
};
ctx.scope.buildUrl();
expect(ctx.scope.shareUrl).to.be('http://server/#/test?from=1000&to=2000&var-app=mupp&var-server=srv-01');
expect(ctx.scope.shareUrl).to.be('http://server/#!/test?from=1000&to=2000&var-app=mupp&var-server=srv-01');
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment