mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-10-09 19:53:32 +01:00
Avoid opening tab path tooltips during automatic focus (#2601)
* Prevent tab tooltips opening on automatic focus * Target expand icons in E2E tree navigation
This commit is contained in:
+4
-3
@@ -118,6 +118,7 @@ function tryGetStandardName(accountType: TestAccount) {
|
||||
: `${process.env.DE_TEST_ACCOUNT_PREFIX}-`;
|
||||
return `${actualPrefix}${accountType.toLocaleLowerCase()}`;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Maps a base API account type to its dedicated connection string (account key) account.
|
||||
@@ -328,12 +329,12 @@ class TreeNode {
|
||||
async expand(): Promise<void> {
|
||||
const treeNodeContainer = this.frame.getByTestId(`TreeNodeContainer:${this.id}`);
|
||||
const tree = this.frame.getByTestId(`Tree:${this.id}`);
|
||||
const expandIcon = this.element.locator(":scope > .fui-TreeItemLayout__expandIcon");
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
const expandNode = async () => {
|
||||
if ((await treeNodeContainer.getAttribute("aria-expanded")) !== "true") {
|
||||
// Click the node, to trigger loading and expansion
|
||||
await this.element.click();
|
||||
await expandIcon.click();
|
||||
}
|
||||
|
||||
// Try three times to wait for the node to expand.
|
||||
@@ -346,7 +347,7 @@ class TreeNode {
|
||||
// Just try again
|
||||
if ((await treeNodeContainer.getAttribute("aria-expanded")) !== "true") {
|
||||
// We might have collapsed the node, try expanding it again, then retry.
|
||||
await this.element.click();
|
||||
await expandIcon.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user