feat(alerting): removes pause per datasource

This commit is contained in:
bergquist
2016-12-19 13:24:45 +01:00
parent 6b9db0c0c5
commit ecdf1888c4
11 changed files with 83 additions and 65 deletions

View File

@@ -39,6 +39,37 @@ func TestAlertingDataAccess(t *testing.T) {
So(err, ShouldBeNil)
})
Convey("Can set new states", func() {
Convey("new state ok", func() {
cmd := &m.SetAlertStateCommand{
AlertId: 1,
State: m.AlertStateOK,
}
err = SetAlertState(cmd)
So(err, ShouldBeNil)
})
Convey("can pause alert", func() {
cmd := &m.PauseAllAlertCommand{
Paused: true,
}
err = PauseAllAlertRule(cmd)
So(err, ShouldBeNil)
Convey("cannot updated paused alert", func() {
cmd := &m.SetAlertStateCommand{
AlertId: 1,
State: m.AlertStateOK,
}
err = SetAlertState(cmd)
So(err, ShouldNotBeNil)
})
})
})
Convey("Can read properties", func() {
alertQuery := m.GetAlertsQuery{DashboardId: testDash.Id, PanelId: 1, OrgId: 1}
err2 := HandleAlertsQuery(&alertQuery)