From 71113bbfc4e93ca1696db9b440b2e6c483ca6073 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 20 Feb 2024 10:23:02 +0000 Subject: [PATCH] Bug 36075: (QA follow-up): Fix tests recall_1 needs to specifically be completed => 0 or else it'll sometimes be 1 and other times be 0 when running tests, causing tests to sometimes fails and other times succeed Signed-off-by: Pedro Amorim --- t/db_dependent/api/v1/recalls.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/api/v1/recalls.t b/t/db_dependent/api/v1/recalls.t index 54c2265ebe2..b51ea9dc0f1 100755 --- a/t/db_dependent/api/v1/recalls.t +++ b/t/db_dependent/api/v1/recalls.t @@ -50,15 +50,16 @@ subtest 'list() tests' => sub { $t->get_ok("//$userid:$password@/api/v1/recalls")->status_is( 200, 'SWAGGER3.2.2' )->json_is( [] ); - my $recall_1 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } ); + my $recall_1 = + $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id, completed => 0 } } ); my $recall_2 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id, completed => 1 } } ); $t->get_ok( "//$userid:$password@/api/v1/recalls?patron_id=" . $patron->id )->status_is( 200, 'SWAGGER3.2.2' ) ->json_is( '' => [ $recall_1->to_api, $recall_2->to_api ], 'Recalls for patron retrieved' ); - $t->get_ok( "//$userid:$password@/api/v1/recalls?completed=false" ) - ->status_is( 200, 'SWAGGER3.2.2' )->json_is( '' => [ $recall_1->to_api ], 'Current recalls retrieved' ); + $t->get_ok("//$userid:$password@/api/v1/recalls?completed=false")->status_is( 200, 'SWAGGER3.2.2' ) + ->json_is( '' => [ $recall_1->to_api ], 'Current recalls retrieved' ); $schema->storage->txn_rollback; }; -- 2.30.2