summaryrefslogtreecommitdiffstats
path: root/app/notification_test.go
diff options
context:
space:
mode:
authorStephen Kiers <stephen@stephenkiers.com>2018-02-13 10:49:48 -0700
committerStephen Kiers <stephen@stephenkiers.com>2018-02-13 10:49:48 -0700
commit08c21f75199f959bbe63396be246e2b7d36a9a39 (patch)
treea70355eb41ae721b40d9822d99d78db976c7a9e6 /app/notification_test.go
parentbdf478c75bb41c00cdfd47bd7ae68c70a06886af (diff)
downloadchat-08c21f75199f959bbe63396be246e2b7d36a9a39.tar.gz
chat-08c21f75199f959bbe63396be246e2b7d36a9a39.tar.bz2
chat-08c21f75199f959bbe63396be246e2b7d36a9a39.zip
Added more tests and simplified code
Diffstat (limited to 'app/notification_test.go')
-rw-r--r--app/notification_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/notification_test.go b/app/notification_test.go
index 61442c048..bd7da3db7 100644
--- a/app/notification_test.go
+++ b/app/notification_test.go
@@ -109,6 +109,24 @@ func TestGetExplicitMentions(t *testing.T) {
},
},
},
+ "OnePersonWithPeriodAtEndOfUsername": {
+ Message: "this is a message for @user.name.",
+ Keywords: map[string][]string{"@user.name.": {id1}},
+ Expected: &ExplicitMentions{
+ MentionedUserIds: map[string]bool{
+ id1: true,
+ },
+ },
+ },
+ "OnePersonWithPeriodAtEndOfUsernameButNotSimilarName": {
+ Message: "this is a message for @user.name.",
+ Keywords: map[string][]string{"@user.name.": {id1}, "@user.name": {id2}},
+ Expected: &ExplicitMentions{
+ MentionedUserIds: map[string]bool{
+ id1: true,
+ },
+ },
+ },
"OnePersonAtEndOfSentence": {
Message: "this is a message for @user.",
Keywords: map[string][]string{"@user": {id1}},