feat(medusa): Add proper pagination (#4517)

* update method for listing regions

* add changeset

* fix unit tests

* listAndCount swaps

* add count calculation to list-returns

* swap integration test

* notes pagination

* pagination props for notifications

* listAndCount store regions

* fix nit

* fix note unit test

* update list-regions store unit test

* cleanup integration test

* rename introduced tests

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Philip Korsholm
2023-07-14 16:14:51 +02:00
committed by GitHub
parent 55db914151
commit 5b91a3503a
21 changed files with 401 additions and 192 deletions

View File

@@ -163,6 +163,22 @@ describe("/admin/notes", () => {
],
})
})
it("should list the notes with correct count in pagination", async () => {
const api = useApi()
const response = await api
.get("/admin/notes?limit=2", {
headers: {
authorization: "Bearer test_token",
},
})
.catch((err) => {
console.log(err)
})
expect(response.data.notes.length).toEqual(2)
expect(response.data.count).toEqual(3)
})
})
describe("POST /admin/notes/:id", () => {