Bugzilla – Attachment 128536 Details for
Bug 29696
"Suggest for purchase" missing biblio link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29696: Add tests
Bug-29696-Add-tests.patch (text/plain), 2.21 KB, created by
Jonathan Druart
on 2021-12-15 06:04:40 UTC
(
hide
)
Description:
Bug 29696: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-12-15 06:04:40 UTC
Size:
2.21 KB
patch
obsolete
>From c66f58ec70ccf27e89f5984f796a190c3e201fa8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Dec 2021 07:02:08 +0100 >Subject: [PATCH] Bug 29696: Add tests > >--- > t/db_dependent/selenium/regressions.t | 35 ++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >index ae2112f1cc3..aa7717f806a 100755 >--- a/t/db_dependent/selenium/regressions.t >+++ b/t/db_dependent/selenium/regressions.t >@@ -20,7 +20,7 @@ use utf8; > > use C4::Context; > >-use Test::More tests => 6; >+use Test::More tests => 7; > use Test::MockModule; > > use C4::Context; >@@ -299,6 +299,39 @@ subtest 'Encoding in session variables' => sub { > > }; > >+subtest 'OPAC - Suggest for purchase' => sub { >+ plan tests => 4; >+ >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 1 } } ); >+ my $password = Koha::AuthUtils::generate_password( $patron->category ); >+ t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >+ $patron->set_password( { password => $password } ); >+ $s->opac_auth( $patron->userid, $password ); >+ >+ my ( $biblionumber, $biblioitemnumber ) = add_biblio(); >+ my $biblio = Koha::Biblios->find($biblionumber); >+ $driver->get( $opac_base_url . "opac-detail.pl?biblionumber=$biblionumber" ); >+ >+ $s->click({ href => '/opac-suggestions.pl?op=add&biblionumber=' . $biblionumber }); >+ is( $driver->find_element('//input[@id="title"]')->get_value(), >+ $biblio->title, >+ "Suggestion's title correctly filled in with biblio's title" ); >+ >+ $driver->find_element('//textarea[@id="note"]')->send_keys('some notes'); >+ $s->submit_form; >+ >+ my $suggestions = Koha::Suggestions->search( { biblionumber => $biblio->biblionumber } ); >+ is( $suggestions->count, 1, 'Suggestion created' ); >+ my $suggestion = $suggestions->next; >+ is( $suggestion->title, $biblio->title, q{suggestion's title has biblio's title} ); >+ is( $suggestion->note, 'some notes', q{suggestion's note correctly saved} ); >+ >+ push @cleanup, $biblio, $suggestion; >+}; >+ >+ > $driver->quit(); > > END { >-- >2.25.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 29696
:
128536
|
128537
|
128701
|
128702
|
128703
|
128818
|
128819