From 5d1f7ea70b0d3e1a5efe43bb4e66b3eda8809802 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 26 Oct 2023 11:32:29 +0100 Subject: [PATCH] Bug 33960: (QA follow-up) Enhance tests --- t/db_dependent/api/v1/biblios.t | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t index de34a0281d7..40e7e9bee85 100755 --- a/t/db_dependent/api/v1/biblios.t +++ b/t/db_dependent/api/v1/biblios.t @@ -1627,7 +1627,7 @@ subtest 'put() tests' => sub { subtest 'list() tests' => sub { - plan tests => 28; + plan tests => 29; $schema->storage->txn_begin; @@ -1690,7 +1690,6 @@ subtest 'list() tests' => sub { Koha::Biblios->search({ 'biblioitem.isbn' => 'TOMAS' }, { join => [ 'biblioitem' ] }) ->delete; - my $isbn_query = encode_json({ isbn => 'TOMAS' }); $biblio->biblioitem->set({ isbn => 'TOMAS' })->store; $t->get_ok( "//$userid:$password@/api/v1/biblios?q=$isbn_query" => @@ -1698,11 +1697,11 @@ subtest 'list() tests' => sub { ->status_is(200); DelBiblio( $biblio->id ); - DelBiblio( $biblio2->id ); - $t->get_ok( "//$userid:$password@/api/v1/biblios/?deleted=1&q=$query" => + $result = $t->get_ok( "//$userid:$password@/api/v1/biblios/?deleted=1&q=$query" => { Accept => 'application/json' } ) - ->status_is(200); + ->status_is(200)->tx->res->json; + is( scalar @{$result}, 1, "Only deleted biblios returned"); $result = $t->get_ok( "//$userid:$password@/api/v1/biblios/?deleted=1&q=$query" => { Accept => 'application/marcxml+xml' } ) @@ -1723,8 +1722,6 @@ subtest 'list() tests' => sub { { Accept => 'text/plain' } ) ->status_is(200); - - $schema->storage->txn_rollback; }; -- 2.41.0