Ensure maximum number of results is shown in FAYT results

Refs #371
This commit is contained in:
Will Abson
2016-10-26 13:10:56 +01:00
parent a8bea1800b
commit 3f440215b9
2 changed files with 20 additions and 2 deletions

View File

@@ -110,6 +110,21 @@ describe('AlfrescoSearchAutocompleteComponent', () => {
updateSearchTerm('searchTerm');
});
it('should limit the number of returned search results to the configured maximum', (done) => {
spyOn(searchService, 'getSearchNodesPromise')
.and.returnValue(Promise.resolve(results));
component.resultsEmitter.subscribe(() => {
fixture.detectChanges();
expect(element.querySelectorAll('table[data-automation-id="autocomplete_results"] tbody tr').length).toBe(2);
done();
});
component.maxResults = 2;
updateSearchTerm('searchTerm');
});
it('should display the correct thumbnail for result items', (done) => {
spyOn(searchService, 'getSearchNodesPromise')