Bug 42443: (QA follow-up) Test from_library_id query filter

The OpenAPI spec documents from_library_id as a supported filter
parameter but the test suite only exercised to_library_id. Add a test
to verify filtering by source library returns the correct transfer.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-06-11 17:24:43 +01:00 committed by Pedro Amorim
parent 02a02c7209
commit e5a07ccd25
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
subtest 'list() tests' => sub {
plan tests => 19;
plan tests => 22;
$schema->storage->txn_begin;
@ -100,6 +100,11 @@ subtest 'list() tests' => sub {
->status_is(200)
->json_is( '' => [ $transfer_0->to_api ], 'filtering by to_library_id returns the matching transfer' );
# Filtering by source library
$t->get_ok( "//$userid:$password@/api/v1/transfers?from_library_id=" . $transfer_1->frombranch )
->status_is(200)
->json_is( '' => [ $transfer_1->to_api ], 'filtering by from_library_id returns the matching transfer' );
# Embeds resolve through the item
$t->get_ok( "//$userid:$password@/api/v1/transfers?to_library_id="
. $library_a->branchcode => { 'x-koha-embed' => 'item.biblio,from_library' } )
@ -179,9 +184,8 @@ subtest 'delete() tests' => sub {
}
}
);
$t->delete_ok(
"//$userid:$password@/api/v1/transfers/" . $arrived_transfer->id => json =>
{ cancellation_reason => 'Manual' } )->status_is(400);
$t->delete_ok( "//$userid:$password@/api/v1/transfers/"
. $arrived_transfer->id => json => { cancellation_reason => 'Manual' } )->status_is(400);
# Cancel an in-transit transfer with the supplied reason
$t->delete_ok(