mirror of https://github.com/grafana/grafana
ux(dashboard): Fixing broken unit test made by changes for dash edit mode, #6442
parent
786afda4c3
commit
18056e53cc
@ -0,0 +1,10 @@ |
||||
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; |
||||
|
||||
import _ from 'lodash'; |
||||
import {DashboardRow} from '../row/row_model'; |
||||
|
||||
describe('DashboardRow', function() { |
||||
|
||||
}); |
||||
|
||||
|
||||
@ -1,34 +0,0 @@ |
||||
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); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
Loading…
Reference in new issue