Bug 23004: Unit test
Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commitb26c2a1863) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitc67f4ce30a) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
d161374e01
commit
b77ba4981c
|
|
@ -82,7 +82,7 @@ $se->mock( 'get_elasticsearch_mappings', sub {
|
|||
});
|
||||
|
||||
subtest 'build_authorities_query_compat() tests' => sub {
|
||||
plan tests => 36;
|
||||
plan tests => 37;
|
||||
|
||||
my $qb;
|
||||
|
||||
|
|
@ -160,6 +160,14 @@ subtest 'build_authorities_query_compat() tests' => sub {
|
|||
"descending sort parameter properly formed"
|
||||
);
|
||||
|
||||
# Authorities type
|
||||
$query = $qb->build_authorities_query_compat( [ 'mainentry' ], undef, undef, ['contains'], [$search_term], 'AUTH_TYPE', 'asc' );
|
||||
is_deeply(
|
||||
$query->{query}->{bool}->{filter},
|
||||
{ term => { 'authtype' => 'auth_type' } },
|
||||
"authorities type code is used as filter"
|
||||
);
|
||||
|
||||
# Failing case
|
||||
throws_ok {
|
||||
$qb->build_authorities_query_compat( [ 'tomas' ], undef, undef, ['contains'], [$search_term], 'AUTH_TYPE', 'asc' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue