Bugzilla – Attachment 172191 Details for
Bug 37398
Initialize a datepicker on all date/datetime fields when adding/editing items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37398: Add a unit test
Bug-37398-Add-a-unit-test.patch (text/plain), 2.23 KB, created by
Phil Ringnalda
on 2024-09-27 22:11:33 UTC
(
hide
)
Description:
Bug 37398: Add a unit test
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-09-27 22:11:33 UTC
Size:
2.23 KB
patch
obsolete
>From 66d20b3f9a5c626752fa95ed344575b9cb409876 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 12 Sep 2024 17:35:15 +0000 >Subject: [PATCH] Bug 37398: Add a unit test > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > t/db_dependent/Koha/UI/Form/Builder/Item.t | 29 +++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/UI/Form/Builder/Item.t b/t/db_dependent/Koha/UI/Form/Builder/Item.t >index 92a7411797..068374e562 100755 >--- a/t/db_dependent/Koha/UI/Form/Builder/Item.t >+++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t >@@ -16,7 +16,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::MockModule; > use Data::Dumper qw( Dumper ); > use utf8; >@@ -239,6 +239,33 @@ subtest 'default_branches_empty' => sub { > is( $subfield->{marc_value}->{values}->[0], "", 'empty option for branches if default_branches_empty passed' ); > }; > >+subtest 'kohafields_to_add_datepicker' => sub { >+ plan tests => 5; >+ >+ my $biblio = >+ $builder->build_sample_biblio( { value => { frameworkcode => '' } } ); >+ my $subfields = >+ Koha::UI::Form::Builder::Item->new( >+ { biblionumber => $biblio->biblionumber } )->edit_form; >+ >+ my @itemfield_test_cases = ( >+ { kohafield => 'items.dateaccessioned', expected_type => 'date' }, >+ { kohafield => 'items.replacementpricedate', expected_type => 'date' }, >+ { kohafield => 'items.datelastborrowed', expected_type => 'date' }, >+ { kohafield => 'items.onloan', expected_type => 'date' }, >+ { kohafield => 'items.datelastseen', expected_type => 'datetime' }, >+ ); >+ >+ foreach my $itemfield_test_case (@itemfield_test_cases) { >+ my ( $subfield ) = grep { $_->{kohafield} eq $itemfield_test_case->{kohafield} } @$subfields; >+ if ( $subfield ) { >+ is( $subfield->{datetype}, $itemfield_test_case->{expected_type}, "Correct datetype for $itemfield_test_case->{kohafield}" ); >+ } else { >+ ok( 0, "Subfield for $itemfield_test_case->{kohafield} not found" ); >+ } >+ } >+}; >+ > subtest 'kohafields_to_ignore' => sub { > plan tests => 2; > >-- >2.44.0
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 37398
:
171416
|
171417
|
171419
|
171420
|
171421
|
171422
|
171423
|
171424
|
171881
|
171882
|
171919
|
171963
|
172187
|
172188
|
172189
|
172190
|
172191
|
172192
|
172193
|
172194
|
172195
|
172196
|
174558
|
174559
|
174560
|
174561
|
174562
|
174563
|
174564
|
174565
|
174566