Have clicking on annotation search result use the preview action if in edit mode (#6331)

* fix preview issue

* reenabled test suite after testing 30x in parallel

* add e2e test and disable unit tests for search

* change to const
This commit is contained in:
Scott Bell
2023-02-14 20:29:18 +01:00
committed by GitHub
parent 6d62e0e73c
commit 8de24a109a
4 changed files with 51 additions and 8 deletions

View File

@@ -291,4 +291,16 @@ xdescribe("GrandSearch", () => {
const previewWindow = document.querySelector('.js-preview-window');
expect(previewWindow.innerText).toContain('Snapshot');
});
it("should preview annotation search results in edit mode if annotation clicked", async () => {
await grandSearchComponent.$children[0].searchEverything('Dri');
grandSearchComponent._provided.openmct.router.path = [mockDisplayLayout];
await Vue.nextTick();
const annotationResults = document.querySelectorAll('[aria-label="Search Result"]');
expect(annotationResults.length).toBe(1);
expect(annotationResults[0].innerText).toContain('Driving');
annotationResults[0].click();
const previewWindow = document.querySelector('.js-preview-window');
expect(previewWindow.innerText).toContain('Snapshot');
});
});