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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user