Add test for index_options.go
This commit is contained in:
parent
563ce1d112
commit
8e16a9c832
1 changed files with 30 additions and 0 deletions
30
internal/photoprism/index_options_test.go
Normal file
30
internal/photoprism/index_options_test.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package photoprism
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIndexOptionsNone(t *testing.T) {
|
||||
result := IndexOptionsNone()
|
||||
assert.Equal(t, false, result.UpdateCamera)
|
||||
assert.Equal(t, false, result.UpdateDate)
|
||||
assert.Equal(t, false, result.UpdateColors)
|
||||
}
|
||||
|
||||
func TestIndexOptions_UpdateAny(t *testing.T) {
|
||||
t.Run("true", func(t *testing.T) {
|
||||
result := IndexOptionsAll()
|
||||
assert.True(t, result.UpdateAny())
|
||||
})
|
||||
|
||||
t.Run("true", func(t *testing.T) {
|
||||
result := IndexOptionsNone()
|
||||
assert.False(t, result.UpdateAny())
|
||||
})
|
||||
}
|
||||
|
||||
func TestIndexOptions_SkipUnchanged(t *testing.T) {
|
||||
result := IndexOptionsNone()
|
||||
assert.True(t, result.SkipUnchanged())
|
||||
}
|
Loading…
Reference in a new issue