Skip to content

Commit

Permalink
[Discover] Fix renaming of saved search not displayed in breadcrumb (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Jun 4, 2020
1 parent 1216b0f commit fa8187b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,13 @@ function discoverController(
// Update defaults so that "reload saved query" functions correctly
setAppState(getStateDefaults());
chrome.docTitle.change(savedSearch.lastSavedTitle);
chrome.setBreadcrumbs([
{
text: discoverBreadcrumbsTitle,
href: '#/',
},
{ text: savedSearch.title },
]);
}
}
});
Expand Down
10 changes: 10 additions & 0 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ export default function ({ getService, getPageObjects }) {
});
});

it('renaming a saved query should modify name in breadcrumb', async function () {
const queryName2 = 'Modified Query # 1';
await PageObjects.discover.loadSavedSearch(queryName1);
await PageObjects.discover.saveSearch(queryName2);

await retry.try(async function () {
expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName2);
});
});

it('should show the correct hit count', async function () {
const expectedHitCount = '14,004';
await retry.try(async function () {
Expand Down

0 comments on commit fa8187b

Please sign in to comment.