mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-04 20:30:23 +03:00
Merge pull request #1 from bpateldx/feature/support-search-for-paths
Make paths searchable
This commit is contained in:
commit
7eb2bbdae3
|
@ -20,6 +20,12 @@ describe('Search', () => {
|
||||||
.first()
|
.first()
|
||||||
.should('contain', 'Introduction');
|
.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 });
|
getSearchInput().type('{esc}', { force: true });
|
||||||
getSearchResults().should('not.exist');
|
getSearchResults().should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@ export class SearchStore<T> {
|
||||||
const recurse = items => {
|
const recurse = items => {
|
||||||
items.forEach(group => {
|
items.forEach(group => {
|
||||||
if (group.type !== '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);
|
recurse(group.items);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user