mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3055] fix bug with page size for facet fields (#3359)
* fix bug with page size for facet fields * move page size to a constant * move const inside the scope * test fixes
This commit is contained in:
committed by
Eugenio Romano
parent
b92cc2ad60
commit
5aa523d9ac
@@ -144,6 +144,35 @@ describe('SearchQueryBuilder', () => {
|
||||
expect(query2).toBeNull();
|
||||
});
|
||||
|
||||
it('should fetch facet from the config by label', () => {
|
||||
const config: SearchConfiguration = {
|
||||
categories: [],
|
||||
facetFields: [
|
||||
{ 'field': 'content.mimetype', 'mincount': 1, 'label': 'Type' },
|
||||
{ 'field': 'content.size', 'mincount': 1, 'label': 'Size' }
|
||||
]
|
||||
};
|
||||
const builder = new SearchQueryBuilderService(buildConfig(config), null);
|
||||
const field = builder.getFacetField('Size');
|
||||
|
||||
expect(field.label).toBe('Size');
|
||||
expect(field.field).toBe('content.size');
|
||||
});
|
||||
|
||||
it('should not fetch facet from the config by label', () => {
|
||||
const config: SearchConfiguration = {
|
||||
categories: [],
|
||||
facetFields: [
|
||||
{ 'field': 'content.mimetype', 'mincount': 1, 'label': 'Type' },
|
||||
{ 'field': 'content.size', 'mincount': 1, 'label': 'Size' }
|
||||
]
|
||||
};
|
||||
const builder = new SearchQueryBuilderService(buildConfig(config), null);
|
||||
const field = builder.getFacetField('Missing');
|
||||
|
||||
expect(field).toBeUndefined();
|
||||
});
|
||||
|
||||
xit('should build query and raise an event on update', async () => {
|
||||
const builder = new SearchQueryBuilderService(buildConfig({}), null);
|
||||
const query = {};
|
||||
|
Reference in New Issue
Block a user