Bug 38872: Add a test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2025-01-13 14:42:23 +01:00 committed by Katrin Fischer
parent 747a60f33a
commit 7fdf2983a9
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 18 additions and 1 deletions

View File

@ -198,7 +198,7 @@ EXPECTED
};
subtest 'Use uri filter if needed' => sub {
plan tests => 4;
plan tests => 5;
my $input = <<INPUT;
<a href="tel:[% patron.phone %]">[% patron.phone %]</a>
<a href="mailto:[% patron.emailpro %]" title="[% patron.emailpro %]">[% patron.emailpro %]</a>
@ -248,6 +248,23 @@ INPUT
],
);
$input = <<INPUT;
<a href="[% good_filter | uri %]">[% var | html %]</a><a href="[% wrong_filter | html %]">[% var | html %]</a>
INPUT
@missing_filters = t::lib::QA::TemplateFilters::missing_filters($input);
is_deeply(
\@missing_filters,
[
{
error => "wrong_html_filter",
line =>
'<a href="[% good_filter | uri %]">[% var | html %]</a><a href="[% wrong_filter | html %]">[% var | html %]</a>',
line_number => 1
}
],
);
$input = <<INPUT;
<a href="[% good_raw_filter | \$raw %]">[% var | html %]</a>
INPUT