Bugzilla – Attachment 73387 Details for
Bug 19564
Fix extraction of sort order from sort condition name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19564: (QA follow-up) Make commented out tests pass
Bug-19564-QA-follow-up-Make-commented-out-tests-pa.patch (text/plain), 2.67 KB, created by
Nick Clemens (kidclamp)
on 2018-03-28 12:47:20 UTC
(
hide
)
Description:
Bug 19564: (QA follow-up) Make commented out tests pass
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-03-28 12:47:20 UTC
Size:
2.67 KB
patch
obsolete
>From e207818321a98dd00e58e60a9287558f0ff66f3f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 28 Mar 2018 12:42:19 +0000 >Subject: [PATCH] Bug 19564: (QA follow-up) Make commented out tests pass > >We likely shoudln't pass through an uncoverted sort order for now, but >it does allow us to look ahead to implementing the orders directly so >seems a good option to have. > >Either this patch should be used, or the commented out tests should be >removed > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > .../Koha_SearchEngine_Elasticsearch_Search.t | 20 ++++++++++---------- > 2 files changed, 11 insertions(+), 11 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 98a2d59..8a0ead1 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -487,7 +487,7 @@ sub _convert_sort_fields { > pubdate => 'pubdate', > ); > my %sort_order_convert = >- ( qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) ); >+ ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) ); > > # Convert the fields and orders, drop anything we don't know about. > grep { $_->{field} } map { >diff --git a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >index de7ef95..5085690 100644 >--- a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >+++ b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >@@ -230,7 +230,7 @@ subtest 'build_query tests' => sub { > }; > > subtest "_convert_sort_fields" => sub { >- plan tests => 1; >+ plan tests => 2; > my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc )); > is_deeply( > \@sort_by, >@@ -242,13 +242,13 @@ subtest "_convert_sort_fields" => sub { > ); > > # We could expect this to pass, but direction is undef instead of 'desc' >- #@sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc )); >- #is_deeply( >- # \@sort_by, >- # [ >- # { field => 'callnum', direction => 'asc' }, >- # { field => 'author', direction => 'desc' } >- # ], >- # 'sort fields should have been split correctly' >- #); >+ @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc )); >+ is_deeply( >+ \@sort_by, >+ [ >+ { field => 'callnum', direction => 'asc' }, >+ { field => 'author', direction => 'desc' } >+ ], >+ 'sort fields should have been split correctly' >+ ); > }; >-- >2.1.4
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 19564
:
68892
|
68998
|
70137
|
73022
|
73023
|
73385
|
73386
| 73387