Bug 39875: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ae2e9e23de)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Pedro Amorim 2025-05-12 13:29:23 +00:00 committed by Paul Derscheid
parent 1210d6aafa
commit 8cf43dc2f9
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 17 additions and 1 deletions

View File

@ -35,7 +35,7 @@ my $isbn = '321321321';
subtest 'show_history_check' => sub {
plan tests => 6;
plan tests => 7;
$schema->storage->txn_begin;
@ -103,6 +103,22 @@ subtest 'show_history_check' => sub {
1, 'Request with ISBN ' . $isbn . ' exists, syspref is on and is same patron. Able to show history check screen'
);
my $metadata_with_no_cardnumber = {
title => 'This is a title',
author => 'This is an author',
isbn => $isbn,
};
my $ill_request_with_no_borrowernumber = $builder->build_sample_ill_request( { borrowernumber => undef } );
my $new_opac_history_check =
Koha::ILL::Request::Workflow::HistoryCheck->new( $metadata_with_no_cardnumber, 'staff' );
is(
$new_opac_history_check->show_history_check($ill_request_with_no_borrowernumber),
0, 'Don\'t show history check for unauthenticated requests'
);
# Mock ILLHistoryCheck disabled
t::lib::Mocks::mock_preference( 'ILLHistoryCheck', 0 );