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> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
3afd4a7e1a
commit
8b76ee39d4
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue