test: add a submenu shouldFocusWrap case to the consumer fixture

This commit is contained in:
maoyingjie
2026-10-25 00:02:42 +08:00
parent 2e4b376537
commit 1e4024a117
+39
View File
@@ -177,6 +177,44 @@ const ModalCase = defineComponent({
},
});
const WrapCase = defineComponent({
name: "WrapCase",
setup() {
return () =>
h("div", { "data-case": "wrap", class: "case" }, [
h(DropdownRoot, { modal: false }, () => [
h(DropdownTrigger, null, () =>
h(Button, { "aria-label": "循环" }, () => "循环"),
),
h(DropdownPopover, null, () =>
h(DropdownMenu, null, () =>
h(DropdownSubmenuTrigger, null, () => [
h(DropdownItem, { id: "wrap-sub", textValue: "子菜单" }, () => [
h(Label, null, () => "子菜单"),
h(DropdownSubmenuIndicator),
]),
h(DropdownPopover, null, () =>
h(DropdownMenu, { shouldFocusWrap: true }, () => [
h(
DropdownItem,
{ id: "wrap-first", textValue: "First" },
() => h(Label, null, () => "First"),
),
h(
DropdownItem,
{ id: "wrap-last", textValue: "Last" },
() => h(Label, null, () => "Last"),
),
]),
),
]),
),
),
]),
]);
},
});
const StandaloneCase = defineComponent({
name: "StandaloneCase",
setup() {
@@ -196,6 +234,7 @@ const cases = {
submenu: SubmenuCase,
modal: ModalCase,
standalone: StandaloneCase,
wrap: WrapCase,
};
const shown = only && cases[only] ? [cases[only]] : Object.values(cases);