|
Lines 169-175
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
| 169 |
}; |
169 |
}; |
| 170 |
|
170 |
|
| 171 |
subtest 'build_query tests' => sub { |
171 |
subtest 'build_query tests' => sub { |
| 172 |
plan tests => 33; |
172 |
plan tests => 35; |
| 173 |
|
173 |
|
| 174 |
my $qb; |
174 |
my $qb; |
| 175 |
|
175 |
|
|
Lines 196-201
subtest 'build_query tests' => sub {
Link Here
|
| 196 |
"sort parameter properly formed" |
196 |
"sort parameter properly formed" |
| 197 |
); |
197 |
); |
| 198 |
|
198 |
|
|
|
199 |
|
| 200 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
| 201 |
my %options; |
| 202 |
$options{expanded_facet} = 'ccode'; |
| 203 |
my $query = $qb->build_query('test', %options); |
| 204 |
ok( defined $query->{aggregations}{ccode}{terms}{size}, |
| 205 |
'ccode facet gets a size parameter if "expanded_facet" passed' ); |
| 206 |
is( $query->{aggregations}{ccode}{terms}{size}, 37, |
| 207 |
'ccode facet gets size matching FacetMaxCount if "expanded_facet" passed' ); |
| 208 |
|
| 199 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
209 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
| 200 |
$query = $qb->build_query(); |
210 |
$query = $qb->build_query(); |
| 201 |
ok( defined $query->{aggregations}{homebranch}, |
211 |
ok( defined $query->{aggregations}{homebranch}, |
| 202 |
- |
|
|