// The document mode switcher expands within 500 ms when the pointer hovers it. import { mockTauri, runSmoke, smokeUrl } from "../_harness/index.mjs"; await runSmoke("editor/modeSwitcherHover", async ({ page }) => { await mockTauri(page, { commands: test => ({ ...test.workspace({ root: "C:\\mode-switcher", files: { "a.md": "# Alpha\n\nTemplate body.\n" } }), plugins_snapshot: () => ({ plugins: [], issues: [] }), spelling_menu_install: () => null, }), }); await page.goto(smokeUrl); await page.locator('[data-tree-rel="a.md"]').click(); await page.locator(".cm-content").waitFor(); await page.locator(".mode-switcher").first().hover(); await page.waitForFunction(() => document.querySelector(".mode-switcher")?.classList.contains("expanded"), null, { timeout: 500 }); await page.mouse.move(500, 400); console.log("PASS: the mode switcher expands on hover"); }, { timeout: 15000 });