From 8af2c9f1f8ed0feba83b3e5dd00ccad726b58bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 16 Feb 2018 13:54:59 +0100 Subject: [PATCH] test: added integration test for #10941 --- pkg/services/sqlstore/alert_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/services/sqlstore/alert_test.go b/pkg/services/sqlstore/alert_test.go index 26909c59233..de86ae87a4f 100644 --- a/pkg/services/sqlstore/alert_test.go +++ b/pkg/services/sqlstore/alert_test.go @@ -80,6 +80,14 @@ func TestAlertingDataAccess(t *testing.T) { So(alert.State, ShouldEqual, "pending") }) + Convey("Viewer cannot read alerts", func() { + alertQuery := m.GetAlertsQuery{DashboardId: testDash.Id, PanelId: 1, OrgId: 1, User: &m.SignedInUser{OrgRole: m.ROLE_VIEWER}} + err2 := HandleAlertsQuery(&alertQuery) + + So(err2, ShouldBeNil) + So(alertQuery.Result, ShouldHaveLength, 0) + }) + Convey("Alerts with same dashboard id and panel id should update", func() { modifiedItems := items modifiedItems[0].Name = "Name"