First implementation of fetching collections of book managed by user

This commit is contained in:
2026-04-02 16:23:22 +02:00
parent acdc3972bd
commit a280647575
18 changed files with 377 additions and 41 deletions

View File

@@ -0,0 +1,21 @@
package apitest
import (
"net/http"
"testing"
"git.artlef.fr/bibliomane/internal/dto"
"git.artlef.fr/bibliomane/internal/testutils"
"github.com/stretchr/testify/assert"
)
func TestFetchAllCollections_OK(t *testing.T) {
status, res := testFetchCollections(t, "10", "0")
assert.Equal(t, http.StatusOK, status)
assert.Equal(t, int64(3), res.Count)
assert.Equal(t, 3, len(res.Collections))
}
func testFetchCollections(t *testing.T, limit string, offset string) (int, dto.CollectionItemsGet) {
return testutils.TestFetchModel[dto.CollectionItemsGet](t, "/ws/collections", limit, offset)
}