Bugzilla – Attachment 156163 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: (QA follow-up) Add exec flag to DB update and expand tests
Bug-32721-QA-follow-up-Add-exec-flag-to-DB-update-.patch (text/plain), 3.18 KB, created by
Matt Blenkinsop
on 2023-09-25 13:33:39 UTC
(
hide
)
Description:
Bug 32721: (QA follow-up) Add exec flag to DB update and expand tests
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-09-25 13:33:39 UTC
Size:
3.18 KB
patch
obsolete
>From e5ee398178bb8be7a95585845dcfaa174af0c7ba Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 5 May 2023 11:05:04 +0000 >Subject: [PATCH] Bug 32721: (QA follow-up) Add exec flag to DB update and > expand tests > >Added tests for case of no branch specific settings and when no branch passed > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../bug_32721-add_branch_level_js.pl | 0 > t/db_dependent/Template/Plugin/Branches.t | 31 ++++++++++++++----- > 2 files changed, 23 insertions(+), 8 deletions(-) > mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >old mode 100644 >new mode 100755 >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index 47722038ad..0c37ae0416 100755 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -220,27 +220,42 @@ subtest 'pickup_locations() tests' => sub { > > subtest 'branch specific js and css' => sub { > >- plan tests => 2; >+ plan tests => 6; > > $schema->storage->txn_begin; > >- my $newbranch = $builder->build({ >+ my $newbranch_with = $builder->build({ > source => 'Branch', > value => { >- branchcode => 'AAA', >- branchname => 'Specific Branch', > userjs => 'console.log(\'Hello World\');', > usercss => 'body { background-color: blue; }' > } > }); >+ my $newbranch_none = $builder->build({ >+ source => 'Branch', >+ value => { >+ userjs => '', >+ usercss => '' >+ } >+ }); > > my $plugin = Koha::Template::Plugin::Branches->new(); > >- my $userjs = $plugin->GetBranchSpecificJS($newbranch->{branchcode}); >- is($userjs, $newbranch->{userjs},'received correct JS string from function'); >+ my $userjs = $plugin->GetBranchSpecificJS($newbranch_with->{branchcode}); >+ is($userjs, $newbranch_with->{userjs},'received correct JS string from function'); >+ >+ my $usercss = $plugin->GetBranchSpecificCSS($newbranch_with->{branchcode}); >+ is($usercss, $newbranch_with->{usercss},'received correct CSS string from function'); >+ >+ $userjs = $plugin->GetBranchSpecificJS($newbranch_none->{branchcode}); >+ $usercss = $plugin->GetBranchSpecificCSS($newbranch_none->{branchcode}); >+ is($userjs, q{},'received correct blank string from function when branch has none'); >+ is($usercss, q{},'received correct blank string from function when branch has none'); > >- my $usercss = $plugin->GetBranchSpecificCSS($newbranch->{branchcode}); >- is($usercss, $newbranch->{usercss},'received correct CSS string from function'); >+ $userjs = $plugin->GetBranchSpecificJS(); >+ $usercss = $plugin->GetBranchSpecificCSS(); >+ is($userjs, q{},'received correct blank string from function when no branch set'); >+ is($usercss, q{},'received correct blank string from function when no branch set'); > > $schema->storage->txn_rollback; > }; >-- >2.37.1 (Apple Git-137.1)
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