From cecb69926f93bd523608b8e8d5c5944320674d37 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 26 Oct 2023 14:56:35 -0300 Subject: [PATCH] Bug 35167: Regression tests Signed-off-by: Tomas Cohen Arazi Signed-off-by: Lucas Gass Signed-off-by: Marcel de Rooy (cherry picked from commit c67d28c5f9136a96bfb665cd13f354af492e3233) Signed-off-by: Fridolin Somers (cherry picked from commit d37fbdb665e598cc630ac351d833d213be222f82) Signed-off-by: Matt Blenkinsop --- t/db_dependent/api/v1/items.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/items.t b/t/db_dependent/api/v1/items.t index 0ab431dbfb..ecf09da71c 100755 --- a/t/db_dependent/api/v1/items.t +++ b/t/db_dependent/api/v1/items.t @@ -106,7 +106,7 @@ subtest 'list() tests' => sub { subtest 'get() tests' => sub { - plan tests => 30; + plan tests => 34; $schema->storage->txn_begin; @@ -183,6 +183,13 @@ subtest 'get() tests' => sub { ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' ) ->json_is( '/effective_not_for_loan_status' => 2, 'effective_not_for_loan_status now picks up itemtype level - item-level_itypes:1' ); + $itype->notforloan(undef)->store(); + $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber )->status_is( 200, 'SWAGGER3.2.2' ) + ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' )->json_is( + '/effective_not_for_loan_status' => 0, + 'effective_not_for_loan_status now picks up itemtype level and falls back to 0 because undef' + ); + t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber ) ->status_is( 200, 'SWAGGER3.2.2' ) -- 2.20.1