feat: articles pagination
This commit is contained in:
1 parent
a2d224240c
commit
73f4b539fe
45 files changed
+3528
-317
No files matched your search
@@ -90,7 +90,7 @@ func TestPublicArticleListingHttp(t *testing.T) {
|
||||
t.Fatalf("expected status 200, got %d", rec.Code)
|
||||
}
|
||||
var got []domainArticle.Article
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil {
|
||||
if err := json.Unmarshal(articleItemsJSON(rec.Body.Bytes()), &got); err != nil {
|
||||
t.Fatalf("failed to decode response: %v", err)
|
||||
}
|
||||
if len(got) != 1 {
|
||||
@@ -112,7 +112,7 @@ func TestPublicArticleListingHttp(t *testing.T) {
|
||||
t.Fatalf("expected status 200, got %d", rec.Code)
|
||||
}
|
||||
var got []domainArticle.Article
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil {
|
||||
if err := json.Unmarshal(articleItemsJSON(rec.Body.Bytes()), &got); err != nil {
|
||||
t.Fatalf("failed to decode response: %v", err)
|
||||
}
|
||||
if len(got) != 2 {
|
||||
@@ -138,7 +138,7 @@ func TestPublicArticleListingHttp(t *testing.T) {
|
||||
t.Fatalf("expected status 200, got %d", rec.Code)
|
||||
}
|
||||
var got []domainArticle.Article
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil {
|
||||
if err := json.Unmarshal(articleItemsJSON(rec.Body.Bytes()), &got); err != nil {
|
||||
t.Fatalf("failed to decode response: %v", err)
|
||||
}
|
||||
if len(got) != 1 {
|
||||
@@ -194,7 +194,7 @@ func TestPublicArticleListingHttp(t *testing.T) {
|
||||
|
||||
t.Run("A repository failure still answers 500 regardless of auth state", func(t *testing.T) {
|
||||
repo := seedPublicArticleListingRepo()
|
||||
repo.fail.failNext("FindByFilters")
|
||||
repo.fail.failNext("FindPage")
|
||||
router := newPublicArticleListingRouter(repo, token)
|
||||
req := httptest.NewRequest(http.MethodGet, "/v1/article/", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
Reference in new issue
Block a user