Bugzilla – Attachment 140862 Details for
Bug 29561
Remove blank facet for languages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29561: Unit test
Bug-29561-Unit-test.patch (text/plain), 2.17 KB, created by
Nick Clemens
on 2022-09-22 19:54:47 UTC
(
hide
)
Description:
Bug 29561: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2022-09-22 19:54:47 UTC
Size:
2.17 KB
patch
obsolete
>From ec7f6f2cce6d853d844d80d01be4c926f7275288 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 22 Sep 2022 19:51:46 +0000 >Subject: [PATCH] Bug 29561: Unit test > >--- > .../Koha/SearchEngine/Elasticsearch/Search.t | 33 +++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t >index bb11422e10..d5fae601ac 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 13; >+use Test::More tests => 14; > use t::lib::Mocks; > > use Koha::SearchEngine::Elasticsearch::QueryBuilder; >@@ -86,7 +86,7 @@ SKIP: { > > eval { $builder->get_elasticsearch_params; }; > >- skip 'Elasticsearch configuration not available', 8 >+ skip 'Elasticsearch configuration not available', 9 > if $@; > > Koha::SearchEngine::Elasticsearch::Indexer->new({ index => 'mydb' })->drop_index; >@@ -123,4 +123,33 @@ SKIP: { > } > ); > is ($searcher->max_result_window, 12000, 'max_result_window returns the correct value'); >+ >+ subtest "_convert_facets" => sub { >+ plan tests => 2; >+ >+ my $es_facets = { >+ 'ln' => { >+ 'sum_other_doc_count' => 0, >+ 'buckets' => [ >+ { >+ 'doc_count' => 2, >+ 'key' => 'eng' >+ }, >+ { >+ 'doc_count' => 12, >+ 'key' => '' >+ } >+ ], >+ 'doc_count_error_upper_bound' => 0 >+ } >+ }; >+ >+ my $koha_facets = $searcher->_convert_facets($es_facets); >+ is(@{$koha_facets->[0]->{facets}},1,"We only get one facet, blank is removed"); >+ >+ $es_facets->{ln}->{buckets}->[1]->{key} = '0'; >+ $koha_facets = $searcher->_convert_facets($es_facets); >+ is(@{$koha_facets->[0]->{facets}},2,"We get two facets, '0' is not removed"); >+ >+ }; > } >-- >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 Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29561
:
127957
|
128100
|
129595
|
140862
|
140863
|
140864
|
141543
|
141544
|
141545