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