photoprism/internal/form/feedback_test.go

26 lines
545 B
Go
Raw Normal View History

2020-10-20 08:07:27 +00:00
package form
import (
"testing"
2020-11-21 17:08:41 +00:00
"github.com/stretchr/testify/assert"
2020-10-20 08:07:27 +00:00
)
func TestFeedback_Empty(t *testing.T) {
t.Run("true", func(t *testing.T) {
feedback := Feedback{}
assert.True(t, feedback.Empty())
})
t.Run("false", func(t *testing.T) {
feedback := Feedback{Message: "I found a bug", Category: "Bug Report", UserEmail: "test@test.com"}
assert.False(t, feedback.Empty())
})
2021-03-11 08:36:47 +00:00
t.Run("false", func(t *testing.T) {
feedback, err := NewFeedback("")
if err != nil {
t.Fatal(err)
}
assert.True(t, feedback.Empty())
})
2020-10-20 08:07:27 +00:00
}