Summary: | Add full-stack tests for API pagination | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Test Suite | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, kyle, martin.renvoize, nick |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.05.00
|
|
Circulation function: | |||
Attachments: |
Bug 30125: Add full-stack tests for API pagination
Bug 30125: Add full-stack tests for API pagination Bug 30125: (QA follow-up) Rename variable as cities Bug 30125: (QA follow-up) Rename variable as cities |
Description
Tomás Cohen Arazi (tcohen)
2022-02-17 17:45:28 UTC
Created attachment 130766 [details] [review] Bug 30125: Add full-stack tests for API pagination This patch adds tests for all the pagination use cases on a real route (GET /cities). It tests _page, _per_page along with the returned Link headers and total counts (i.e. X-Total-Count, X-Base-Total-Count), and the results themselves. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/pagination.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 130826 [details] [review] Bug 30125: Add full-stack tests for API pagination This patch adds tests for all the pagination use cases on a real route (GET /cities). It tests _page, _per_page along with the returned Link headers and total counts (i.e. X-Total-Count, X-Base-Total-Count), and the results themselves. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/pagination.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Excellent addition, clear code, tests passing. Going straight for PQA. Created attachment 130827 [details] [review] Bug 30125: (QA follow-up) Rename variable as cities It's what we are testing :-) (In reply to Nick Clemens from comment #4) > Created attachment 130827 [details] [review] [review] > Bug 30125: (QA follow-up) Rename variable as cities > > It's what we are testing :-) Can't you live with some bit of confusion dude? Haha > is( scalar @{$cities}, 10, '10 libraries retrieved' );
Also rename '10 cities retrieved' no ?
Created attachment 131100 [details] [review] Bug 30125: (QA follow-up) Rename variable as cities It's what we are testing :-) (In reply to Fridolin Somers from comment #6) > > is( scalar @{$cities}, 10, '10 libraries retrieved' ); > Also rename '10 cities retrieved' no ? Done. I've amended Nick's patch. Pushed to master for 22.05, thanks to everybody involved [U+1F984] |