The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/test/specs/row-ctrl-specs.js

35 lines
962 B

define([
'./helpers',
'app/features/dashboard/rowCtrl'
], function(helpers) {
'use strict';
describe('RowCtrl', function() {
var ctx = new helpers.ControllerTestContext();
beforeEach(module('grafana.controllers'));
beforeEach(ctx.providePhase());
beforeEach(ctx.createControllerPhase('RowCtrl'));
describe('delete_row', function () {
describe('when row is empty (has no panels)', function () {
beforeEach(function () {
ctx.scope.dashboard.rows = [{id: 1, panels: []}];
ctx.scope.row = ctx.scope.dashboard.rows[0];
ctx.scope.appEvent = sinon.spy();
ctx.scope.deleteRow();
});
it('should NOT ask for confirmation', function () {
expect(ctx.scope.appEvent.called).to.be(false);
});
it('should delete row', function () {
expect(ctx.scope.dashboard.rows).to.not.contain(ctx.scope.row);
});
});
});
});
});