[Discover] Fix renaming of saved search not displayed in breadcrumb (#67577)

This commit is contained in:
Matthias Wilhelm 2020-06-04 11:45:08 +02:00 committed by GitHub
parent 1216b0f7cd
commit fa8187ba2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -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 },
]);
}
}
});

View file

@ -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 () {