refactor: simplify hover menu logic and update related tests for workspace switcher

This commit is contained in:
mlogclub
2026-06-21 10:29:54 +08:00
parent fe5041191f
commit 991243625d
2 changed files with 5 additions and 45 deletions
+4 -1
View File
@@ -14,8 +14,11 @@ it("wraps the dropdown label in a Base UI menu group", async () => {
assert.match(source, /<DropdownMenuGroup>[\s\S]*<DropdownMenuLabel>\{t\("workspace\.switchWorkspace"\)\}<\/DropdownMenuLabel>/);
});
it("does not auto-open the rail menu from focus events", async () => {
it("does not auto-open the rail menu from focus or hover events", async () => {
assert.doesNotMatch(source, /onFocus=\{openHoverMenu\}/);
assert.doesNotMatch(source, /onBlur=\{closeHoverMenu\}/);
assert.doesNotMatch(source, /onPointerEnter=\{openHoverMenu\}/);
assert.doesNotMatch(source, /onPointerLeave=\{closeHoverMenu\}/);
assert.doesNotMatch(source, /hoverOpen/);
});
});