diff options
author | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-14 00:53:04 -0500 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-14 00:53:04 -0500 |
commit | 88d693a950fad663016a84407c90b8de280c0252 (patch) | |
tree | 571d01753c39f320b3634eae5723b76904d6bd48 /app/notification_test.go | |
parent | 3fef21e350737c235e6dfc2d9f35311d65290c3e (diff) | |
parent | 82209b9452f3241c879591bd29a163538cb70b5e (diff) | |
download | chat-88d693a950fad663016a84407c90b8de280c0252.tar.gz chat-88d693a950fad663016a84407c90b8de280c0252.tar.bz2 chat-88d693a950fad663016a84407c90b8de280c0252.zip |
Merge branch 'release-4.7' into icu753
Diffstat (limited to 'app/notification_test.go')
-rw-r--r-- | app/notification_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app/notification_test.go b/app/notification_test.go index cc501fbd0..43703c019 100644 --- a/app/notification_test.go +++ b/app/notification_test.go @@ -109,6 +109,33 @@ 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}}, + Expected: &ExplicitMentions{ + MentionedUserIds: map[string]bool{ + id1: true, + }, + }, + }, "OnePersonWithoutAtMention": { Message: "this is a message for @user", Keywords: map[string][]string{"this": {id1}}, @@ -179,6 +206,24 @@ func TestGetExplicitMentions(t *testing.T) { }, }, }, + "AtUserWithPeriodAtEndOfSentence": { + Message: "this is a message for @user.period.", + Keywords: map[string][]string{"@user.period": {id1}}, + Expected: &ExplicitMentions{ + MentionedUserIds: map[string]bool{ + id1: true, + }, + }, + }, + "UserWithPeriodAtEndOfSentence": { + Message: "this is a message for user.period.", + Keywords: map[string][]string{"user.period": {id1}}, + Expected: &ExplicitMentions{ + MentionedUserIds: map[string]bool{ + id1: true, + }, + }, + }, "PotentialOutOfChannelUser": { Message: "this is an message for @potential and @user", Keywords: map[string][]string{"@user": {id1}}, |