Improve search filter component: hide a facet if there is no filter category (#6282)

* New feature: Search Filter Component - Hide facet if there is no filter category

* remove comments

* Fix lint errors

* Fix-Add unit tests

* Change demo shell facet query to current year

* Fix search e2e to use always current year

Co-authored-by: Raphael Kister <raphael.kister@alfresco.com>
Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
This commit is contained in:
arditdomi
2020-11-04 15:57:40 +00:00
committed by GitHub
parent 9c1b6dbc69
commit 5f76a7c340
4 changed files with 77 additions and 30 deletions

View File

@@ -34,6 +34,7 @@ import {
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { SearchConfiguration } from './search.config';
import moment from 'moment-es6';
describe('Search Filters', () => {
@@ -177,6 +178,14 @@ describe('Search Filters', () => {
});
it('[C291980] Should group search facets under specified labels', async () => {
const currentYear = moment().year();
jsonFile.facetQueries.queries[0] = {'query': `created:${currentYear}`, 'label': 'SEARCH.FACET_QUERIES.CREATED_THIS_YEAR'};
jsonFile.facetQueries.queries[1] = {'query': `content.mimetype:text/html`, 'label': 'SEARCH.FACET_QUERIES.MIMETYPE', 'group': 'Type facet queries'};
jsonFile.facetQueries.queries[2] = {'query': `content.size:[0 TO 10240]`, 'label': 'SEARCH.FACET_QUERIES.XTRASMALL', 'group': 'Size facet queries'};
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();