|
|
@@ -7,6 +7,7 @@ define([
|
|
|
|
|
|
describe('ShareModalCtrl', function() {
|
|
|
var ctx = new helpers.ControllerTestContext();
|
|
|
+ var browser;
|
|
|
|
|
|
function setTime(range) {
|
|
|
ctx.timeSrv.timeRange = sinon.stub().returns(range);
|
|
|
@@ -31,6 +32,17 @@ define([
|
|
|
expect(ctx.scope.shareUrl).to.be('http://server/#/test?from=1000&to=2000&panelId=22&fullscreen');
|
|
|
});
|
|
|
|
|
|
+ it('should generate render url', function() {
|
|
|
+ ctx.$location.$$absUrl = 'http://dashboards.grafana.com/dashboard/db/my-dash';
|
|
|
+
|
|
|
+ ctx.scope.panel = { id: 22 };
|
|
|
+
|
|
|
+ ctx.scope.init();
|
|
|
+ var base = 'http://dashboards.grafana.com/render/dashboard-solo/db/my-dash';
|
|
|
+ var params = '?from=1000&to=2000&panelId=22&fullscreen&width=1000&height=500';
|
|
|
+ expect(ctx.scope.imageUrl).to.be(base + params);
|
|
|
+ });
|
|
|
+
|
|
|
it('should remove panel id when no panel in scope', function() {
|
|
|
ctx.$location.path('/test');
|
|
|
ctx.scope.options.forCurrent = true;
|