Bugzilla – Attachment 126988 Details for
Bug 29146
Default values from the framework should only be applied at biblio/item creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29146: Add test for editing existing item
Bug-29146-Add-test-for-editing-existing-item.patch (text/plain), 1.71 KB, created by
Marcel de Rooy
on 2021-10-27 12:58:47 UTC
(
hide
)
Description:
Bug 29146: Add test for editing existing item
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-10-27 12:58:47 UTC
Size:
1.71 KB
patch
obsolete
>From c672cc0438a8361609a2ef9e0f0dd653ec44d2d7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 27 Oct 2021 12:30:07 +0000 >Subject: [PATCH] Bug 29146: Add test for editing existing item >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/Koha/UI/Form/Builder/Item.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/UI/Form/Builder/Item.t | 10 +++++++++- > 1 file changed, 9 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 386241c637..602f018c76 100755 >--- a/t/db_dependent/Koha/UI/Form/Builder/Item.t >+++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t >@@ -131,7 +131,7 @@ subtest 'authorised values' => sub { > }; > > subtest 'prefill_with_default_values' => sub { >- plan tests => 2; >+ plan tests => 3; > > my $biblio = $builder->build_sample_biblio({ value => {frameworkcode => ''}}); > my $subfields = >@@ -150,6 +150,14 @@ subtest 'prefill_with_default_values' => sub { > ($subfield) = grep { $_->{subfield} eq 'é' } @$subfields; > is( $subfield->{marc_value}->{value}, 'ééé', 'default value should be set if prefill_with_default_values passed'); > >+ # Do the same for an existing item; we do not expect the defaultvalue to popup >+ my $item = $builder->build_sample_item; >+ $subfields = Koha::UI::Form::Builder::Item->new({ >+ biblionumber => $biblio->biblionumber, >+ item => $item->unblessed, >+ })->edit_form({ prefill_with_default_values => 1 }); >+ ($subfield) = grep { $_->{subfield} eq 'é' } @$subfields; >+ is( $subfield->{marc_value}->{value}, q{}, 'default value not applied to existing item'); > > }; > >-- >2.20.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 29146
:
125541
|
126981
|
126985
|
126988
|
127041
|
127042
|
127043
|
127578
|
127579
|
127580