fix(e2e): fix grand search test

This commit is contained in:
Jesse Mazzella 2023-07-21 16:52:00 -07:00
parent b41c98d4ab
commit 724ec423d1
2 changed files with 6 additions and 6 deletions

View File

@ -77,11 +77,11 @@ test.describe('Grand Search', () => {
// Click [aria-label="OpenMCT Search"] a >> nth=0 // Click [aria-label="OpenMCT Search"] a >> nth=0
await page.locator('[aria-label="Search Result"] >> nth=0').click(); await page.locator('[aria-label="Search Result"] >> nth=0').click();
await expect(page.locator('[aria-label="Search Result"] >> nth=0')).toBeHidden(); await expect(page.locator('[aria-label="Search Result"] >> nth=0')).toBeInViewport();
// Fill [aria-label="OpenMCT Search"] input[type="search"] // Fill [aria-label="OpenMCT Search"] input[type="search"]
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('foo'); await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('foo');
await expect(page.locator('[aria-label="Search Result"] >> nth=0')).toBeHidden(); await expect(page.locator('[aria-label="Search Result"] >> nth=0')).not.toBeInViewport();
// Click text=Snapshot Save and Finish Editing Save and Continue Editing >> button >> nth=1 // Click text=Snapshot Save and Finish Editing Save and Continue Editing >> button >> nth=1
await page await page

View File

@ -27,7 +27,7 @@
v-if="dismissable" v-if="dismissable"
aria-label="Close" aria-label="Close"
class="c-click-icon c-overlay__close-button icon-x" class="c-click-icon c-overlay__close-button icon-x"
@click="destroy" @click.stop="destroy"
></button> ></button>
<div <div
ref="element" ref="element"
@ -71,16 +71,16 @@ export default {
}); });
}, },
methods: { methods: {
destroy: function () { destroy() {
if (this.dismissable) { if (this.dismissable) {
this.dismiss(); this.dismiss();
} }
}, },
buttonClickHandler: function (method) { buttonClickHandler(method) {
method(); method();
this.$emit('destroy'); this.$emit('destroy');
}, },
getElementForFocus: function () { getElementForFocus() {
const defaultElement = this.$refs.element; const defaultElement = this.$refs.element;
if (!this.$refs.buttons) { if (!this.$refs.buttons) {
return defaultElement; return defaultElement;