This commit is contained in:
parent
3a40c92458
commit
9ef5f01872
|
@ -59,10 +59,17 @@ export const [getUrlTracker, setUrlTracker] = createGetterSetter<{
|
|||
export const [getDocViewsRegistry, setDocViewsRegistry] = createGetterSetter<DocViewsRegistry>(
|
||||
'DocViewsRegistry'
|
||||
);
|
||||
|
||||
/**
|
||||
* Makes sure discover and context are using one instance of history.
|
||||
*/
|
||||
export const getHistory = _.once(() => createHashHistory());
|
||||
export const getHistory = _.once(() => {
|
||||
const history = createHashHistory();
|
||||
history.listen(() => {
|
||||
// keep at least one listener so that `history.location` always in sync
|
||||
});
|
||||
return history;
|
||||
});
|
||||
|
||||
/**
|
||||
* Discover currently uses two `history` instances: one from Kibana Platform and
|
||||
|
|
|
@ -18,7 +18,8 @@ export default function ({ getService, getPageObjects }) {
|
|||
const retry = getService('retry');
|
||||
const docTable = getService('docTable');
|
||||
const filterBar = getService('filterBar');
|
||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
|
||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'context']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
describe('context link in discover', () => {
|
||||
before(async () => {
|
||||
|
@ -69,5 +70,29 @@ export default function ({ getService, getPageObjects }) {
|
|||
}
|
||||
expect(disabledFilterCounter).to.be(TEST_FILTER_COLUMN_NAMES.length);
|
||||
});
|
||||
|
||||
// bugfix: https://github.com/elastic/kibana/issues/92099
|
||||
it('should navigate to the first document and then back to discover', async () => {
|
||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
||||
|
||||
// navigate to the doc view
|
||||
await docTable.clickRowToggle({ rowIndex: 0 });
|
||||
|
||||
// click the open action
|
||||
await retry.try(async () => {
|
||||
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
||||
if (!rowActions.length) {
|
||||
throw new Error('row actions empty, trying again');
|
||||
}
|
||||
await rowActions[1].click();
|
||||
});
|
||||
|
||||
const hasDocHit = await testSubjects.exists('doc-hit');
|
||||
expect(hasDocHit).to.be(true);
|
||||
|
||||
await testSubjects.click('breadcrumb first');
|
||||
await PageObjects.discover.waitForDiscoverAppOnScreen();
|
||||
await PageObjects.discover.waitForDocTableLoadingComplete();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue