Bugzilla – Attachment 127580 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.78 KB, created by
Martin Renvoize (ashimema)
on 2021-11-12 11:19:01 UTC
(
hide
)
Description:
Bug 29146: Add test for editing existing item
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-12 11:19:01 UTC
Size:
1.78 KB
patch
obsolete
>From fc0f418ba1ab9b45709e61cec279458541686ef4 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 > >Test plan: >Run t/db_dependent/Koha/UI/Form/Builder/Item.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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 ead8517d32..56ebd091c3 100755 >--- a/t/db_dependent/Koha/UI/Form/Builder/Item.t >+++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t >@@ -134,7 +134,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 = >@@ -153,6 +153,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