Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 12; |
20 |
use Test::More tests => 13; |
21 |
use t::lib::Mocks; |
21 |
use t::lib::Mocks; |
22 |
|
22 |
|
23 |
use Koha::SearchEngine::Elasticsearch::QueryBuilder; |
23 |
use Koha::SearchEngine::Elasticsearch::QueryBuilder; |
Lines 229-231
subtest 'build_query tests' => sub {
Link Here
|
229 |
); |
229 |
); |
230 |
}; |
230 |
}; |
231 |
|
231 |
|
232 |
- |
232 |
subtest "_convert_sort_fields" => sub { |
|
|
233 |
plan tests => 1; |
234 |
my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc )); |
235 |
is_deeply( |
236 |
\@sort_by, |
237 |
[ |
238 |
{ field => 'callnum', direction => 'asc' }, |
239 |
{ field => 'author', direction => 'desc' } |
240 |
], |
241 |
'sort fields should have been split correctly' |
242 |
); |
243 |
|
244 |
# We could expect this to pass, but direction is undef instead of 'desc' |
245 |
#@sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc )); |
246 |
#is_deeply( |
247 |
# \@sort_by, |
248 |
# [ |
249 |
# { field => 'callnum', direction => 'asc' }, |
250 |
# { field => 'author', direction => 'desc' } |
251 |
# ], |
252 |
# 'sort fields should have been split correctly' |
253 |
#); |
254 |
}; |