Bug 40372: Remove warning from api/v1/holds.t

t/db_dependent/api/v1/holds.t .. 1/16 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602.

We do not test the notification here, we can simply ignore the letters
code

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-15 11:05:52 +02:00 committed by Lucas Gass
parent da423a717e
commit c14e72e782
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,8 @@
use Modern::Perl;
use Test::More tests => 16;
use Test::More tests => 17;
use Test::NoWarnings;
use Test::MockModule;
use Test::Mojo;
use t::lib::TestBuilder;
@ -199,6 +200,10 @@ subtest "Test endpoints with permission" => sub {
plan tests => 45;
# Prevent warning 'No reserves HOLD_CANCELLATION letter transported by email'
my $mock_letters = Test::MockModule->new('C4::Letters');
$mock_letters->mock( 'GetPreparedLetter', sub { return } );
$t->get_ok("//$userid_1:$password@/api/v1/holds")->status_is(200)->json_has('/0')->json_has('/1')->json_hasnt('/2');
$t->get_ok("//$userid_1:$password@/api/v1/holds?priority=2")->status_is(200)