Bugzilla – Attachment 145748 Details for
Bug 28314
Spinning icon is not always going away for local covers in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug 32366: (bug 30460 follow-up) Add tests
Bug-32366-bug-30460-follow-up-Add-tests.patch (text/plain), 2.59 KB, created by
ByWater Sandboxes
on 2023-01-27 14:31:18 UTC
(
hide
)
Description:
Bug 32366: (bug 30460 follow-up) Add tests
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-01-27 14:31:18 UTC
Size:
2.59 KB
patch
obsolete
>From 51e1dc40b2f9c5682a0a343872c79008519cbb3b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Nov 2022 08:55:13 +0100 >Subject: [PATCH] Bug 32366: (bug 30460 follow-up) Add tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> > >https://bugs.koha-community.org/show_bug.cgi?id=28314 >--- > .../Koha/BackgroundJobs/BatchDeleteBiblio.t | 20 ++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t b/t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t >index 60e60ed049..fa1a332fb4 100755 >--- a/t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t >+++ b/t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t >@@ -36,10 +36,12 @@ my $builder = t::lib::TestBuilder->new; > > subtest "process() tests" => sub { > >- plan tests => 2; >+ plan tests => 3; > > $schema->storage->txn_begin; > >+ t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); >+ > my $biblio = $builder->build_sample_biblio; > my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->id }); > my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->id }); >@@ -54,11 +56,18 @@ subtest "process() tests" => sub { > } > ); > >- my $counter = 0; >+ my $update_biblio_counter = 0; > > my $mock_holds_queue_job = Test::MockModule->new('Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue'); > $mock_holds_queue_job->mock( 'enqueue', sub { >- $counter++; >+ $update_biblio_counter++; >+ }); >+ >+ my $index_biblio_counter = 0; >+ >+ my $mock_index = Test::MockModule->new("Koha::SearchEngine::Elasticsearch::Indexer"); >+ $mock_index->mock( 'index_records', sub { >+ $index_biblio_counter++; > }); > > my $job = Koha::BackgroundJob::BatchDeleteBiblio->new( >@@ -81,7 +90,8 @@ subtest "process() tests" => sub { > } > ); > >- is( $counter, 1, 'Holds queue update is enqueued only once' ); >+ is( $update_biblio_counter, 1, 'Holds queue update is enqueued only once' ); >+ is( $index_biblio_counter, 1, 'Index update is enqueued only once' ); > > t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); > >@@ -105,7 +115,7 @@ subtest "process() tests" => sub { > } > ); > >- is( $counter, 1, 'Counter untouched with RealTimeHoldsQueue disabled' ); >+ is( $update_biblio_counter, 1, 'Counter untouched with RealTimeHoldsQueue disabled' ); > > $schema->storage->txn_rollback; > }; >-- >2.30.2
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 Raw
Actions:
View
Attachments on
bug 28314
:
145333
|
145481
|
145748
|
145938