Bugzilla – Attachment 146162 Details for
Bug 32721
Allow specifying UserCSS and UserJS at library level for the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32721: Add unit tests
Bug-32721-Add-unit-tests.patch (text/plain), 1.84 KB, created by
Lucas Gass (lukeg)
on 2023-02-03 17:33:24 UTC
(
hide
)
Description:
Bug 32721: Add unit tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-02-03 17:33:24 UTC
Size:
1.84 KB
patch
obsolete
>From 1411d79c0f307d55a25565a9149d64eb5f6129b6 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 27 Jan 2023 12:59:10 +0000 >Subject: [PATCH] Bug 32721: Add unit tests > >Unit tests to test two new functions: GetBranchSpecificJS and GetBranchSpecificCSS > >Test plan: >1) In the shell run prove -t t/db_dependent/Template/Plugin/Branches.t > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > t/db_dependent/Template/Plugin/Branches.t | 29 ++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index a1145d6693e..fe23f008750 100755 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -16,7 +16,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > > use C4::Context; >@@ -217,3 +217,30 @@ subtest 'pickup_locations() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'branch specfic js and css' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $newbranch = $builder->build({ >+ source => 'Branch', >+ value => { >+ branchcode => 'AAA', >+ branchname => 'Specific Branch', >+ userjs => 'console.log(\'Hello World\');', >+ usercss => 'body { background-color: blue; }' >+ } >+ }); >+ >+ my $plugin = Koha::Template::Plugin::Branches->new(); >+ >+ my $userjs = $plugin->GetBranchSpecificJS($newbranch->{branchcode}); >+ is($userjs, $newbranch->{userjs},'received correct JS string from function'); >+ >+ my $usercss = $plugin->GetBranchSpecificCSS($newbranch->{branchcode}); >+ is($usercss, $newbranch->{usercss},'received correct CSS string from function'); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32721
:
145731
|
145732
|
145733
|
145734
|
145735
|
145754
|
145759
|
146159
|
146160
|
146161
|
146162
|
146163
|
146164
|
147373
|
149860
|
149861
|
149862
|
149863
|
149864
|
149865
|
149866
|
150713
|
150724
|
150725
|
150726
|
150727
|
150728
|
150729
|
150730
|
150731
|
150732
|
150754
|
150755
|
150756
|
150757
|
150758
|
156157
|
156158
|
156159
|
156160
|
156161
|
156162
|
156163
|
156164
|
157335