Bug 26847: Add UI test for categorycode in masthead

This test adds a regression test for the addition of categorycode
into the masthead of the staff client.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 69bf6e80cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fac4d77e12)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Martin Renvoize 2020-11-04 14:45:27 +00:00 committed by Victor Grousset/tuxayo
parent b6026fdf59
commit eea4e102c6
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,8 @@ my $AudioAlerts_value = C4::Context->preference('AudioAlerts');
C4::Context->set_preference('AudioAlerts', '1');
our @cleanup;
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub {
plan tests => 2;
subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' => sub {
plan tests => 3;
my $patron = $builder->build_object(
{ class => 'Koha::Patrons', value => { flags => 1 } } );
@ -66,6 +66,9 @@ subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub {
);
is( $elt->get_attribute('data-borrowernumber', 1), $patron->borrowernumber,
"Since bug 20921 span.loggedinusername should contain data-borrowernumber"
);
is( $elt->get_attribute('data-categorycode'), $patron->categorycode,
"Since bug 26847 span.loggedinusername should contain data-categorycode"
);
push @cleanup, $patron, $patron->category, $patron->library;
};