Bug 41330: Unit tests

Do not apply patches before
1 - Create a new subscription to a serial
2 - Go to 'Serial Collection' panel and click on edit serials button
3 - Try and edit the serial number to "{1}" -> error 500
4 - Apply only unit tests patch and run `prove t/Serials/ModSerialStatus.t` -> Tests will
  not pass
5 - Apply patch and proceed again to 2&3 -> you will get no error
6 - run `prove t/Serials/ModSerialStatus.t` -> tests will pass

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Baptiste Wojtkowski 2025-11-28 10:54:01 +00:00 committed by Lucas Gass
parent b6fea1c1ab
commit 4fd0ba028c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,7 @@ use Modern::Perl;
use Data::Dumper qw/Dumper/;
use Test::NoWarnings;
use Test::More tests => 9;
use Test::More tests => 10;
use C4::Serials;
@ -33,6 +33,7 @@ is( C4::Serials::_handle_seqno( '2017 (No. 8)', $list ), $list,
is( C4::Serials::_handle_seqno( '2017 (No. 9)', $list ), $list, 'Not added 9' );
is( C4::Serials::_handle_seqno( '2017 (No. 10)', $list ), $list, 'Not added 10' );
is( C4::Serials::_handle_seqno( '2017 (No. 11)', $list ), $list . '; 2017 (No. 11)', 'Added 11' );
is( C4::Serials::_handle_seqno( '{1}', $list ), $list . '; {1}', 'Added {1}' );
is( C4::Serials::_handle_seqno( '2017 (No. 7)', $list, 'REMOVE' ), $list, 'Not removed 7' );
is( C4::Serials::_handle_seqno( '2017 (No. 10)', $list, 'REMOVE' ) !~ /\(10\)/, 1, 'Removed 10' );
is( C4::Serials::_handle_seqno( '2017 (No. 8)', $list, 'CHECK' ), 1, 'Found 8' );