Close the workspace menu on a second click of its button
The menu is an automatic popover. A press on the button closed the open menu, and the click that followed opened it again. The picker now records an open menu when the press starts on the button. The click then leaves the menu closed. The workspace smoke test clicks the button two times. Card 53db89fc.
This commit is contained in:
@@ -66,7 +66,12 @@ await runSmoke("workspace/openAndCreate", async ({ page }) => {
|
||||
assert.equal(await menu.locator('[aria-current="true"]').count(), 1);
|
||||
assert.equal(await page.evaluate(() => window.__TEST__.calls.filter(c => c.command === "plugin:dialog|open").length), 0);
|
||||
await page.screenshot({ path: path.join(output, "workspaces-menu.png") });
|
||||
const opened = await page.evaluate(() => window.__TEST__.calls.filter(c => c.command === "workspace_open").length);
|
||||
// A second click on the switcher closes the menu. It does not open the menu again.
|
||||
await trigger.click();
|
||||
await menu.waitFor({ state: "hidden", timeout: 2000 });
|
||||
await trigger.click();
|
||||
await menu.getByText("D:\\Writing\\Notes", { exact: true }).waitFor();
|
||||
const opened =await page.evaluate(() => window.__TEST__.calls.filter(c => c.command === "workspace_open").length);
|
||||
await menu.getByRole("button").filter({ hasText: "Current" }).click();
|
||||
assert.equal(await page.evaluate(() => window.__TEST__.calls.filter(c => c.command === "workspace_open").length), opened);
|
||||
await page.keyboard.press("Control+o");
|
||||
|
||||
Reference in New Issue
Block a user