Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance search feature to support path #2145

Merged
merged 8 commits into from
Sep 6, 2022
Merged
6 changes: 6 additions & 0 deletions e2e/integration/search.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
2 changes: 1 addition & 1 deletion src/services/SearchStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down