feat(aio): improve search results functionality
* Ensure that all indexed documents are displayed in the search results. (Previously the guide documents were not appearing because we only showed results that had a `name` property, rather than a `name` or `title`.) * Group the results by their containing folder (e.g. api, guide, tutorial, etc). * Hide the results when the user hits the ESC key. * Hide the results when the user clicks on a search result Closes #14852
This commit is contained in:

committed by
Chuck Jazdzewski

parent
8850098ea4
commit
6497633529
@ -3,6 +3,8 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
export class MockLocationService {
|
||||
urlSubject = new BehaviorSubject<string>(this.initialUrl);
|
||||
currentUrl = this.urlSubject.asObservable();
|
||||
search = jasmine.createSpy('search').and.returnValue({});
|
||||
setSearch = jasmine.createSpy('setSearch');
|
||||
constructor(private initialUrl) {}
|
||||
}
|
||||
|
||||
|
10
aio/src/testing/search.service.ts
Normal file
10
aio/src/testing/search.service.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { SearchResults } from 'app/search/search.service';
|
||||
|
||||
export class MockSearchService {
|
||||
searchResults = new Subject<SearchResults>();
|
||||
initWorker = jasmine.createSpy('initWorker');
|
||||
loadIndex = jasmine.createSpy('loadIndex');
|
||||
search = jasmine.createSpy('search');
|
||||
hideResults = jasmine.createSpy('hideResults');
|
||||
}
|
Reference in New Issue
Block a user