mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Backend: Add unit tests for internal/api
This commit is contained in:
20
internal/api/errors_test.go
Normal file
20
internal/api/errors_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetErrors(t *testing.T) {
|
||||
//TODO add error fixtures
|
||||
t.Run("successful request", func(t *testing.T) {
|
||||
app, router, _ := NewApiTest()
|
||||
GetErrors(router)
|
||||
r := PerformRequest(app, "GET", "/api/v1/errors")
|
||||
//val := gjson.Get(r.Body.String(), "flags")
|
||||
//assert.Equal(t, "public debug settings", val.String())
|
||||
assert.Equal(t, http.StatusOK, r.Code)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user