test: add new handler test files for analytics, auth, kobo, library, progress, and sidecar

This commit is contained in:
2026-02-14 21:38:08 -05:00
parent acd194c217
commit 6346e9bc27
7 changed files with 362 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package handlers
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestParseUUID_Library(t *testing.T) {
validUUID := "f47ac10b-58cc-4372-a567-0e02b2c3d479"
result, err := parseUUID(validUUID)
require.NoError(t, err)
assert.True(t, result.Valid)
}
func TestParseUUID_Invalid(t *testing.T) {
tests := []struct {
name string
input string
}{
{"not a uuid", "not-a-uuid"},
{"empty", ""},
{"wrong format", "f47ac10b-58cc-4372"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := parseUUID(tt.input)
assert.Error(t, err)
})
}
}