mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(templating): fixed failing unit tests in PR #4287
This commit is contained in:
parent
2475ca8f9a
commit
6fac471415
@ -34,12 +34,13 @@ define([
|
|||||||
options: [{text: "test", value: "test"}]
|
options: [{text: "test", value: "test"}]
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function(done) {
|
||||||
var dashboard = { templating: { list: [variable] } };
|
var dashboard = { templating: { list: [variable] } };
|
||||||
var urlParams = {};
|
var urlParams = {};
|
||||||
urlParams["var-apps"] = "new";
|
urlParams["var-apps"] = "new";
|
||||||
ctx.$location.search = sinon.stub().returns(urlParams);
|
ctx.$location.search = sinon.stub().returns(urlParams);
|
||||||
ctx.service.init(dashboard);
|
ctx.service.init(dashboard).then(function() { done(); });
|
||||||
|
ctx.$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update current value', function() {
|
it('should update current value', function() {
|
||||||
@ -56,12 +57,13 @@ define([
|
|||||||
options: [{text: "val1", value: "val1"}, {text: 'val2', value: 'val2'}, {text: 'val3', value: 'val3', selected: true}]
|
options: [{text: "val1", value: "val1"}, {text: 'val2', value: 'val2'}, {text: 'val3', value: 'val3', selected: true}]
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function(done) {
|
||||||
var dashboard = { templating: { list: [variable] } };
|
var dashboard = { templating: { list: [variable] } };
|
||||||
var urlParams = {};
|
var urlParams = {};
|
||||||
urlParams["var-apps"] = ["val2", "val1"];
|
urlParams["var-apps"] = ["val2", "val1"];
|
||||||
ctx.$location.search = sinon.stub().returns(urlParams);
|
ctx.$location.search = sinon.stub().returns(urlParams);
|
||||||
ctx.service.init(dashboard);
|
ctx.service.init(dashboard).then(function() { done(); });
|
||||||
|
ctx.$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update current value', function() {
|
it('should update current value', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user