Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
eba147c1
Unverified
Commit
eba147c1
authored
Aug 24, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change/add tests for alerting notification reminders
parent
51069c9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
pkg/services/sqlstore/alert_notification_test.go
+19
-2
No files found.
pkg/services/sqlstore/alert_notification_test.go
View file @
eba147c1
...
...
@@ -3,6 +3,7 @@ package sqlstore
import
(
"context"
"testing"
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
m
"github.com/grafana/grafana/pkg/models"
...
...
@@ -88,7 +89,7 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
})
})
Convey
(
"Cannot update alert notifier with
notitfyonce
= false"
,
func
()
{
Convey
(
"Cannot update alert notifier with
send reminder
= false"
,
func
()
{
cmd
:=
&
m
.
CreateAlertNotificationCommand
{
Name
:
"ops update"
,
Type
:
"email"
,
...
...
@@ -134,6 +135,7 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
So
(
cmd
.
Result
.
Id
,
ShouldNotEqual
,
0
)
So
(
cmd
.
Result
.
OrgId
,
ShouldNotEqual
,
0
)
So
(
cmd
.
Result
.
Type
,
ShouldEqual
,
"email"
)
So
(
cmd
.
Result
.
Frequency
,
ShouldEqual
,
10
*
time
.
Second
)
Convey
(
"Cannot save Alert Notification with the same name"
,
func
()
{
err
=
CreateAlertNotificationCommand
(
cmd
)
...
...
@@ -146,13 +148,28 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
Type
:
"webhook"
,
OrgId
:
cmd
.
Result
.
OrgId
,
SendReminder
:
true
,
Frequency
:
"
1
0s"
,
Frequency
:
"
6
0s"
,
Settings
:
simplejson
.
New
(),
Id
:
cmd
.
Result
.
Id
,
}
err
:=
UpdateAlertNotification
(
newCmd
)
So
(
err
,
ShouldBeNil
)
So
(
newCmd
.
Result
.
Name
,
ShouldEqual
,
"NewName"
)
So
(
newCmd
.
Result
.
Frequency
,
ShouldEqual
,
60
*
time
.
Second
)
})
Convey
(
"Can update alert notification to disable sending of reminders"
,
func
()
{
newCmd
:=
&
m
.
UpdateAlertNotificationCommand
{
Name
:
"NewName"
,
Type
:
"webhook"
,
OrgId
:
cmd
.
Result
.
OrgId
,
SendReminder
:
false
,
Settings
:
simplejson
.
New
(),
Id
:
cmd
.
Result
.
Id
,
}
err
:=
UpdateAlertNotification
(
newCmd
)
So
(
err
,
ShouldBeNil
)
So
(
newCmd
.
Result
.
SendReminder
,
ShouldBeFalse
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment