Bug 39712: Add tests

Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-06-24 12:21:23 +02:00 committed by Lucas Gass
parent 3b5b3cf29c
commit 5beaaf171d
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 48 additions and 0 deletions

48
t/Koha/Manual.t Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Test::NoWarnings;
use Test::More tests => 2;
use Koha::Manual;
subtest 'VueJS components' => sub {
my $tests = {
q{http://localhost:8081/cgi-bin/koha/erm/agreements} =>
q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements},
q{/koha/erm/agreements} => q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements},
q{/koha/erm/agreements/add} =>
q{https://koha-community.org/manual/25.05/en/html/erm.html#create-an-agreement-record},
q{/koha/erm/agreements/edit/1} =>
q{https://koha-community.org/manual/25.05/en/html/erm.html#create-an-agreement-record},
q{/koha/erm/agreements?by_expired=true&max_expiration_date=2025-06-24} =>
q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements},
};
plan tests => scalar keys %$tests;
my $language = 'en';
while ( my ( $refer, $expected ) = each(%$tests) ) {
is(
Koha::Manual::get_url( $refer, $language ), $expected,
sprintf( "%s should link to %s", $refer, $expected )
);
}
};