Merge pull request #1 from bpateldx/feature/support-search-for-paths

Make paths searchable
This commit is contained in:
bpateldx 2022-08-30 10:18:28 -04:00 committed by GitHub
commit 7eb2bbdae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,12 @@ describe('Search', () => {
.first()
.should('contain', 'Introduction');
getSearchInput().clear().type('uploadImage', { force: true });
cy.get('[role=search] [role=menuitem]')
.should('have.length', 1)
.first()
.should('contain', 'uploads an image');
getSearchInput().type('{esc}', { force: true });
getSearchResults().should('not.exist');
});

View File

@ -26,7 +26,7 @@ export class SearchStore<T> {
const recurse = items => {
items.forEach(group => {
if (group.type !== 'group') {
this.add(group.name, group.description || '', group.id);
this.add(group.name, (group.description || '').concat(' ', group.path || ''), group.id);
}
recurse(group.items);
});