test: add comprehensive tests for notes and highlights

- Add complete test suite for media notes API with validation
- Add complete test suite for media highlights API with color validation
- Add backward compatibility tests for ebook endpoints
- Test authentication scenarios (unauthorized access)
- Test request validation and error handling
- Fix existing test import issues and syntax errors
- Add test cases for highlight-note associations
This commit is contained in:
2026-01-28 15:43:30 -05:00
parent 78851a940a
commit 0a457e02a2
3 changed files with 388 additions and 47 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
package main
import (
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAuthMiddleware(t *testing.T) {
func TestAuthMiddlewareAlt(t *testing.T) {
// Test missing JWT header
t.Run("Missing JWT", func(t *testing.T) {
req := httptest.NewRequest("GET", "/api/libraries/visible", nil)