mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
test(alerting): fix broken unit tests
This commit is contained in:
parent
77b7cdfadb
commit
8dbb5bad4b
@ -346,7 +346,7 @@ func TestAlertModel(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
alerts := *cmd.GetAlertModels()
|
alerts := cmd.GetAlertModels()
|
||||||
|
|
||||||
Convey("all properties have been set", func() {
|
Convey("all properties have been set", func() {
|
||||||
So(alerts, ShouldNotBeEmpty)
|
So(alerts, ShouldNotBeEmpty)
|
||||||
|
@ -40,7 +40,7 @@ func TestAlertRuleChangesDataAccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := m.SaveAlertsCommand{
|
cmd := m.SaveAlertsCommand{
|
||||||
Alerts: &items,
|
Alerts: items,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: FakeOrgId,
|
OrgId: FakeOrgId,
|
||||||
UserId: 2,
|
UserId: 2,
|
||||||
|
@ -34,7 +34,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := m.SaveAlertsCommand{
|
cmd := m.SaveAlertsCommand{
|
||||||
Alerts: &items,
|
Alerts: items,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
UserId: 1,
|
UserId: 1,
|
||||||
@ -80,7 +80,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
UserId: 1,
|
UserId: 1,
|
||||||
Alerts: &modifiedItems,
|
Alerts: modifiedItems,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := SaveAlerts(&modifiedCmd)
|
err := SaveAlerts(&modifiedCmd)
|
||||||
@ -135,7 +135,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Alerts = &multipleItems
|
cmd.Alerts = multipleItems
|
||||||
err = SaveAlerts(&cmd)
|
err = SaveAlerts(&cmd)
|
||||||
|
|
||||||
Convey("Should save 3 dashboards", func() {
|
Convey("Should save 3 dashboards", func() {
|
||||||
@ -156,7 +156,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
Convey("should updated two dashboards and delete one", func() {
|
Convey("should updated two dashboards and delete one", func() {
|
||||||
missingOneAlert := multipleItems[:2]
|
missingOneAlert := multipleItems[:2]
|
||||||
|
|
||||||
cmd.Alerts = &missingOneAlert
|
cmd.Alerts = missingOneAlert
|
||||||
err = SaveAlerts(&cmd)
|
err = SaveAlerts(&cmd)
|
||||||
|
|
||||||
Convey("should delete the missing alert", func() {
|
Convey("should delete the missing alert", func() {
|
||||||
@ -195,7 +195,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := m.SaveAlertsCommand{
|
cmd := m.SaveAlertsCommand{
|
||||||
Alerts: &items,
|
Alerts: items,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
UserId: 1,
|
UserId: 1,
|
||||||
|
@ -33,7 +33,7 @@ func TestAlertingStateAccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := m.SaveAlertsCommand{
|
cmd := m.SaveAlertsCommand{
|
||||||
Alerts: &items,
|
Alerts: items,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
UserId: 1,
|
UserId: 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user