From 4fe22ca9d6dd07275249e3fb0b10cf350f5f0670 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Mon, 29 Aug 2022 18:02:01 -0400 Subject: [PATCH] Make paths searchable --- e2e/integration/search.e2e.ts | 6 ++++++ src/services/SearchStore.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/e2e/integration/search.e2e.ts b/e2e/integration/search.e2e.ts index 5785ee80..ccf2ff14 100644 --- a/e2e/integration/search.e2e.ts +++ b/e2e/integration/search.e2e.ts @@ -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'); }); diff --git a/src/services/SearchStore.ts b/src/services/SearchStore.ts index 4600c0ec..feb19c69 100644 --- a/src/services/SearchStore.ts +++ b/src/services/SearchStore.ts @@ -26,7 +26,7 @@ export class SearchStore { 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); });