diff options
Diffstat (limited to 'model/reaction_test.go')
-rw-r--r-- | model/reaction_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/model/reaction_test.go b/model/reaction_test.go index e980b106d..e447e4329 100644 --- a/model/reaction_test.go +++ b/model/reaction_test.go @@ -57,6 +57,21 @@ func TestReactionIsValid(t *testing.T) { t.Fatal(err) } + reaction.EmojiName = "emoji-" + if err := reaction.IsValid(); err != nil { + t.Fatal(err) + } + + reaction.EmojiName = "emoji_" + if err := reaction.IsValid(); err != nil { + t.Fatal(err) + } + + reaction.EmojiName = "emoji:" + if err := reaction.IsValid(); err == nil { + t.Fatal(err) + } + reaction.CreateAt = 0 if err := reaction.IsValid(); err == nil { t.Fatal("create at should be invalid") |