|
@@ -59,16 +59,16 @@ define([
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
var dashboard = { templating: { list: [variable] } };
|
|
var dashboard = { templating: { list: [variable] } };
|
|
|
var urlParams = {};
|
|
var urlParams = {};
|
|
|
- urlParams["var-apps"] = ["val1", "val2"];
|
|
|
|
|
|
|
+ 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);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('should update current value', function() {
|
|
it('should update current value', function() {
|
|
|
expect(variable.current.value.length).to.be(2);
|
|
expect(variable.current.value.length).to.be(2);
|
|
|
- expect(variable.current.value[0]).to.be("val1");
|
|
|
|
|
- expect(variable.current.value[1]).to.be("val2");
|
|
|
|
|
- expect(variable.current.text).to.be("val1 + val2");
|
|
|
|
|
|
|
+ expect(variable.current.value[0]).to.be("val2");
|
|
|
|
|
+ expect(variable.current.value[1]).to.be("val1");
|
|
|
|
|
+ expect(variable.current.text).to.be("val2 + val1");
|
|
|
expect(variable.options[0].selected).to.be(true);
|
|
expect(variable.options[0].selected).to.be(true);
|
|
|
expect(variable.options[1].selected).to.be(true);
|
|
expect(variable.options[1].selected).to.be(true);
|
|
|
});
|
|
});
|