fix reaction's name validation with + sign in it (#6221)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
f9502ff14b
Коммит
6fa7082833
@@ -42,16 +42,6 @@ func TestReactionIsValid(t *testing.T) {
|
||||
}
|
||||
|
||||
reaction.PostId = NewId()
|
||||
reaction.EmojiName = ""
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal("emoji name should be invalid")
|
||||
}
|
||||
|
||||
reaction.EmojiName = strings.Repeat("a", 65)
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal("emoji name should be invalid")
|
||||
}
|
||||
|
||||
reaction.EmojiName = strings.Repeat("a", 64)
|
||||
if err := reaction.IsValid(); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -67,11 +57,26 @@ func TestReactionIsValid(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
reaction.EmojiName = "+1"
|
||||
if err := reaction.IsValid(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
reaction.EmojiName = "emoji:"
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
reaction.EmojiName = ""
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal("emoji name should be invalid")
|
||||
}
|
||||
|
||||
reaction.EmojiName = strings.Repeat("a", 65)
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal("emoji name should be invalid")
|
||||
}
|
||||
|
||||
reaction.CreateAt = 0
|
||||
if err := reaction.IsValid(); err == nil {
|
||||
t.Fatal("create at should be invalid")
|
||||
|
||||
Ссылка в новой задаче
Block a user