photoprism/pkg/clean/orientation_test.go
Michael Mayer 9ad86ac017 Edit: Change image orientation through the user interface #464
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-03-20 16:18:27 +01:00

27 lines
580 B
Go

package clean
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestOrientation(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
assert.Equal(t, 0, Orientation(0))
})
t.Run("Valid", func(t *testing.T) {
assert.Equal(t, 1, Orientation(1))
assert.Equal(t, 3, Orientation(3))
assert.Equal(t, 5, Orientation(5))
assert.Equal(t, 7, Orientation(7))
assert.Equal(t, 8, Orientation(8))
})
t.Run("Invalid", func(t *testing.T) {
assert.Equal(t, 0, Orientation(-1))
assert.Equal(t, 0, Orientation(9))
assert.Equal(t, 0, Orientation(2000))
})
}