diff options
author | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-14 00:48:30 -0500 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-14 00:48:30 -0500 |
commit | 50b648156c22e00e994976fb0d7a31428e36189e (patch) | |
tree | f48a8fe9586004786586db42784598f13d7d613d /app/notification_test.go | |
parent | 963150b6ec81b2fc4118ab4291aa4b93866e4475 (diff) | |
parent | 69e56fc04237ae5a821a9d97c48bc830111d6c78 (diff) | |
download | chat-50b648156c22e00e994976fb0d7a31428e36189e.tar.gz chat-50b648156c22e00e994976fb0d7a31428e36189e.tar.bz2 chat-50b648156c22e00e994976fb0d7a31428e36189e.zip |
Merge branch 'ICU-764' into release-4.7
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 11f4df685..bd7da3db7 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}}, |