@sapudex/web-components 2.57.0 → 2.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/specs/FilterMenu.cy.tsx +209 -19
- package/cypress/specs/List.cy.tsx +67 -4
- package/cypress/specs/ListItem.cy.tsx +35 -9
- package/cypress/specs/SelectBox.cy.tsx +100 -0
- package/cypress/specs/TabNavigation.cy.tsx +297 -21
- package/dist/List.d.ts +15 -1
- package/dist/List.js +23 -2
- package/dist/List.js.map +1 -1
- package/dist/ListGroupHeaderBase.d.ts +13 -0
- package/dist/ListGroupHeaderBase.js +43 -2
- package/dist/ListGroupHeaderBase.js.map +1 -1
- package/dist/ListGroupHeaderTemplate.js +26 -7
- package/dist/ListGroupHeaderTemplate.js.map +1 -1
- package/dist/ListItem.d.ts +0 -3
- package/dist/ListItem.js +18 -12
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemBase.d.ts +17 -0
- package/dist/ListItemBase.js +15 -0
- package/dist/ListItemBase.js.map +1 -1
- package/dist/ListItemTemplate.js +2 -2
- package/dist/ListItemTemplate.js.map +1 -1
- package/dist/MastheadCountrySelector.js +5 -5
- package/dist/MastheadCountrySelector.js.map +1 -1
- package/dist/MastheadCountrySelectorTemplate.d.ts +2 -0
- package/dist/MastheadCountrySelectorTemplate.js +15 -0
- package/dist/MastheadCountrySelectorTemplate.js.map +1 -0
- package/dist/MastheadItem.d.ts +0 -3
- package/dist/MastheadItem.js +3 -6
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadItemTemplate.d.ts +2 -0
- package/dist/MastheadItemTemplate.js +41 -0
- package/dist/MastheadItemTemplate.js.map +1 -0
- package/dist/MastheadMenu.d.ts +1 -0
- package/dist/MastheadMenu.js +4 -6
- package/dist/MastheadMenu.js.map +1 -1
- package/dist/MastheadMenuItem.d.ts +0 -3
- package/dist/MastheadMenuItem.js +3 -6
- package/dist/MastheadMenuItem.js.map +1 -1
- package/dist/MastheadMenuItemTemplate.d.ts +2 -0
- package/dist/MastheadMenuItemTemplate.js +36 -0
- package/dist/MastheadMenuItemTemplate.js.map +1 -0
- package/dist/MastheadMenuTemplate.d.ts +2 -0
- package/dist/MastheadMenuTemplate.js +13 -0
- package/dist/MastheadMenuTemplate.js.map +1 -0
- package/dist/MastheadMobileMenu.js +3 -3
- package/dist/MastheadMobileMenu.js.map +1 -1
- package/dist/MastheadMobileMenuTemplate.d.ts +2 -0
- package/dist/MastheadMobileMenuTemplate.js +33 -0
- package/dist/MastheadMobileMenuTemplate.js.map +1 -0
- package/dist/MastheadProfileMenu.d.ts +2 -4
- package/dist/MastheadProfileMenu.js +5 -20
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadProfileMenuTemplate.d.ts +2 -0
- package/dist/MastheadProfileMenuTemplate.js +24 -0
- package/dist/MastheadProfileMenuTemplate.js.map +1 -0
- package/dist/MastheadShell.js +3 -5
- package/dist/MastheadShell.js.map +1 -1
- package/dist/MastheadShellTemplate.d.ts +2 -0
- package/dist/MastheadShellTemplate.js +20 -0
- package/dist/MastheadShellTemplate.js.map +1 -0
- package/dist/SearchableListBase.d.ts +10 -0
- package/dist/SearchableListBase.js +34 -1
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SearchableListBaseTemplate.js +35 -4
- package/dist/SearchableListBaseTemplate.js.map +1 -1
- package/dist/SecondaryNavigation.d.ts +1 -0
- package/dist/SecondaryNavigation.js +20 -6
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/SelectBase.js +8 -3
- package/dist/SelectBase.js.map +1 -1
- package/dist/Tab.d.ts +0 -7
- package/dist/Tab.js +4 -19
- package/dist/Tab.js.map +1 -1
- package/dist/TabHeaderTemplate.d.ts +2 -0
- package/dist/TabHeaderTemplate.js +15 -0
- package/dist/TabHeaderTemplate.js.map +1 -0
- package/dist/TabInOverflowTemplate.d.ts +2 -0
- package/dist/TabInOverflowTemplate.js +7 -0
- package/dist/TabInOverflowTemplate.js.map +1 -0
- package/dist/TabNavigation.d.ts +3 -4
- package/dist/TabNavigation.js +53 -40
- package/dist/TabNavigation.js.map +1 -1
- package/dist/TabNavigationPopoverTemplate.d.ts +2 -0
- package/dist/TabNavigationPopoverTemplate.js +9 -0
- package/dist/TabNavigationPopoverTemplate.js.map +1 -0
- package/dist/TabNavigationTemplate.d.ts +2 -0
- package/dist/TabNavigationTemplate.js +10 -0
- package/dist/TabNavigationTemplate.js.map +1 -0
- package/dist/TabTemplate.d.ts +2 -0
- package/dist/TabTemplate.js +5 -0
- package/dist/TabTemplate.js.map +1 -0
- package/dist/assets/{InputSuggestions-C8grDr_8.js → InputSuggestions-CMYjJsHw.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-BQtSr7yg.js → ListItemStandardExpandableTextTemplate-D2i8wWuR.js} +1 -1
- package/dist/assets/{bundle.esm-GvPkDyXP.js → bundle.esm-BjN47C_y.js} +242 -242
- package/dist/assets/messagebundle_en-B7YJOdQz.js +1 -0
- package/dist/css/themes/Button.css +1 -1
- package/dist/css/themes/ListGroupHeader.css +1 -1
- package/dist/css/themes/PromoTile.css +1 -1
- package/dist/css/themes/TabInOverflow.css +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -1
- package/dist/generated/i18n/i18n-defaults.js +3 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Button.css.d.ts +1 -1
- package/dist/generated/themes/Button.css.js +1 -1
- package/dist/generated/themes/Button.css.js.map +1 -1
- package/dist/generated/themes/ListGroupHeader.css.d.ts +1 -1
- package/dist/generated/themes/ListGroupHeader.css.js +1 -1
- package/dist/generated/themes/ListGroupHeader.css.js.map +1 -1
- package/dist/generated/themes/PromoTile.css.d.ts +1 -1
- package/dist/generated/themes/PromoTile.css.js +1 -1
- package/dist/generated/themes/PromoTile.css.js.map +1 -1
- package/dist/generated/themes/TabInOverflow.css.d.ts +1 -1
- package/dist/generated/themes/TabInOverflow.css.js +1 -1
- package/dist/generated/themes/TabInOverflow.css.js.map +1 -1
- package/dist/messagebundle.properties +4 -0
- package/dist/messagebundle_en.properties +2 -0
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
- package/src/List.ts +24 -2
- package/src/ListGroupHeaderBase.ts +44 -2
- package/src/ListGroupHeaderTemplate.tsx +74 -23
- package/src/ListItem.ts +18 -15
- package/src/ListItemBase.ts +30 -0
- package/src/ListItemTemplate.tsx +4 -4
- package/src/MastheadCountrySelector.ts +5 -5
- package/src/MastheadCountrySelectorTemplate.tsx +98 -0
- package/src/MastheadItem.ts +3 -6
- package/src/MastheadItemTemplate.tsx +178 -0
- package/src/MastheadMenu.ts +5 -6
- package/src/MastheadMenuItem.ts +3 -7
- package/src/MastheadMenuItemTemplate.tsx +123 -0
- package/src/MastheadMenuTemplate.tsx +142 -0
- package/src/MastheadMobileMenu.ts +3 -3
- package/src/MastheadMobileMenuTemplate.tsx +274 -0
- package/src/MastheadProfileMenu.ts +10 -23
- package/src/MastheadProfileMenuTemplate.tsx +143 -0
- package/src/MastheadShell.ts +3 -5
- package/src/MastheadShellTemplate.tsx +228 -0
- package/src/SearchableListBase.ts +37 -1
- package/src/SearchableListBaseTemplate.tsx +38 -2
- package/src/SecondaryNavigation.ts +21 -6
- package/src/SelectBase.ts +8 -3
- package/src/Tab.ts +4 -24
- package/src/TabHeaderTemplate.tsx +153 -0
- package/src/TabInOverflowTemplate.tsx +68 -0
- package/src/TabNavigation.ts +61 -44
- package/src/TabNavigationPopoverTemplate.tsx +27 -0
- package/src/TabNavigationTemplate.tsx +98 -0
- package/src/TabTemplate.tsx +7 -0
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/themes/Button.css.ts +1 -1
- package/src/generated/themes/ListGroupHeader.css.ts +1 -1
- package/src/generated/themes/PromoTile.css.ts +1 -1
- package/src/generated/themes/TabInOverflow.css.ts +1 -1
- package/src/i18n/messagebundle.properties +4 -0
- package/src/i18n/messagebundle_en.properties +2 -0
- package/src/themes/Button.css +2 -1
- package/src/themes/ListGroupHeader.css +50 -7
- package/src/themes/PromoTile.css +1 -0
- package/src/themes/TabInOverflow.css +9 -4
- package/dist/assets/messagebundle_en-DBpf5Il2.js +0 -1
- package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.js +0 -13
- package/dist/generated/templates/MastheadCountrySelectorTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadItemTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadItemTemplate.lit.js +0 -43
- package/dist/generated/templates/MastheadItemTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadMenuItemTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadMenuItemTemplate.lit.js +0 -21
- package/dist/generated/templates/MastheadMenuItemTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadMenuTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadMenuTemplate.lit.js +0 -25
- package/dist/generated/templates/MastheadMenuTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js +0 -37
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js +0 -18
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js.map +0 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/MastheadShellTemplate.lit.js +0 -28
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TabHeaderTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TabHeaderTemplate.lit.js +0 -52
- package/dist/generated/templates/TabHeaderTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TabInOverflowTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TabInOverflowTemplate.lit.js +0 -15
- package/dist/generated/templates/TabInOverflowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TabNavigationPopoverTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TabNavigationPopoverTemplate.lit.js +0 -8
- package/dist/generated/templates/TabNavigationPopoverTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TabNavigationTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TabNavigationTemplate.lit.js +0 -16
- package/dist/generated/templates/TabNavigationTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TabTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TabTemplate.lit.js +0 -7
- package/dist/generated/templates/TabTemplate.lit.js.map +0 -1
- package/src/MastheadCountrySelector.hbs +0 -76
- package/src/MastheadItem.hbs +0 -136
- package/src/MastheadMenu.hbs +0 -131
- package/src/MastheadMenuItem.hbs +0 -102
- package/src/MastheadMobileMenu.hbs +0 -253
- package/src/MastheadProfileMenu.hbs +0 -121
- package/src/MastheadShell.hbs +0 -223
- package/src/Tab.hbs +0 -1
- package/src/TabHeader.hbs +0 -141
- package/src/TabInOverflow.hbs +0 -59
- package/src/TabNavigation.hbs +0 -88
- package/src/TabNavigationPopover.hbs +0 -18
- package/src/generated/templates/MastheadCountrySelectorTemplate.lit.ts +0 -17
- package/src/generated/templates/MastheadItemTemplate.lit.ts +0 -47
- package/src/generated/templates/MastheadMenuItemTemplate.lit.ts +0 -25
- package/src/generated/templates/MastheadMenuTemplate.lit.ts +0 -29
- package/src/generated/templates/MastheadMobileMenuTemplate.lit.ts +0 -41
- package/src/generated/templates/MastheadProfileMenuTemplate.lit.ts +0 -22
- package/src/generated/templates/MastheadShellTemplate.lit.ts +0 -32
- package/src/generated/templates/TabHeaderTemplate.lit.ts +0 -56
- package/src/generated/templates/TabInOverflowTemplate.lit.ts +0 -19
- package/src/generated/templates/TabNavigationPopoverTemplate.lit.ts +0 -12
- package/src/generated/templates/TabNavigationTemplate.lit.ts +0 -20
- package/src/generated/templates/TabTemplate.lit.ts +0 -11
|
@@ -104,6 +104,23 @@ filter-name="Filter Name">
|
|
|
104
104
|
</UDExFilterMenuGroupHeader>
|
|
105
105
|
</UDExFilterMenu>
|
|
106
106
|
|
|
107
|
+
const filterMenuTwoGroups = <UDExFilterMenu
|
|
108
|
+
id="filter-menu-two-groups"
|
|
109
|
+
mode={UDExListMode.MultiSelect}
|
|
110
|
+
filter-name="Filter Name">
|
|
111
|
+
<UDExFilterMenuGroupHeader collapsible label="Backend Languages">
|
|
112
|
+
<UDExFilterMenuItem label="Python"></UDExFilterMenuItem>
|
|
113
|
+
<UDExFilterMenuItem label="Ruby"></UDExFilterMenuItem>
|
|
114
|
+
<UDExFilterMenuItem label="Node.js"></UDExFilterMenuItem>
|
|
115
|
+
</UDExFilterMenuGroupHeader>
|
|
116
|
+
<UDExFilterMenuGroupHeader collapsible label="Frontend Languages">
|
|
117
|
+
<UDExFilterMenuItem label="JavaScript"></UDExFilterMenuItem>
|
|
118
|
+
<UDExFilterMenuItem label="Swift"></UDExFilterMenuItem>
|
|
119
|
+
<UDExFilterMenuItem label="HTML"></UDExFilterMenuItem>
|
|
120
|
+
<UDExFilterMenuItem label="CSS"></UDExFilterMenuItem>
|
|
121
|
+
</UDExFilterMenuGroupHeader>
|
|
122
|
+
</UDExFilterMenu>
|
|
123
|
+
|
|
107
124
|
const filterMenuRadioGroup = <UDExFilterMenu
|
|
108
125
|
id="filter-menu-radio-group"
|
|
109
126
|
disable-target-overlap="true"
|
|
@@ -576,6 +593,51 @@ describe("Filter Menu component", () => {
|
|
|
576
593
|
});
|
|
577
594
|
});
|
|
578
595
|
|
|
596
|
+
describe("Filter Menu grouped tree — per-group position", () => {
|
|
597
|
+
beforeEach(() => {
|
|
598
|
+
cy.mount(filterMenuTwoGroups);
|
|
599
|
+
cy.get("[udex-filter-menu]").shadow().find(".udex-filter-menu__trigger").click();
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
// Regression: the sibling-group tree markup makes JAWS/NVDA compute a flattened
|
|
603
|
+
// posinset/setsize across every group's children (e.g. "5 of 7" instead of
|
|
604
|
+
// "1 of 4"). Explicit per-group aria-posinset/aria-setsize on each child treeitem
|
|
605
|
+
// restores the within-group count. Two groups of different sizes (Backend x3,
|
|
606
|
+
// Frontend x4) prove the count restarts per group rather than spanning all 7.
|
|
607
|
+
it('exposes per-group aria-posinset/aria-setsize on child treeitems so screen readers count within each group', () => {
|
|
608
|
+
// Backend Languages children: 1..3 within their own group of 3.
|
|
609
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(0)
|
|
610
|
+
.find("udex-list-item").then($items => {
|
|
611
|
+
expect($items).to.have.length(3);
|
|
612
|
+
});
|
|
613
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(0)
|
|
614
|
+
.find("udex-list-item").eq(0).shadow().find("[part=item]")
|
|
615
|
+
.should("have.attr", "aria-posinset", "1").and("have.attr", "aria-setsize", "3");
|
|
616
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(0)
|
|
617
|
+
.find("udex-list-item").eq(2).shadow().find("[part=item]")
|
|
618
|
+
.should("have.attr", "aria-posinset", "3").and("have.attr", "aria-setsize", "3");
|
|
619
|
+
|
|
620
|
+
// Frontend Languages children: count restarts at 1 with its own setsize (4),
|
|
621
|
+
// NOT continued as "4 of 7" across both groups.
|
|
622
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(1)
|
|
623
|
+
.find("udex-list-item").eq(0).shadow().find("[part=item]")
|
|
624
|
+
.should("have.attr", "aria-posinset", "1").and("have.attr", "aria-setsize", "4");
|
|
625
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(1)
|
|
626
|
+
.find("udex-list-item").eq(3).shadow().find("[part=item]")
|
|
627
|
+
.should("have.attr", "aria-posinset", "4").and("have.attr", "aria-setsize", "4");
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
it('positions each group header among the groups (N of group count)', () => {
|
|
631
|
+
// The collapsible MultiSelect header treeitem is the inner list-item's [part=item].
|
|
632
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(0)
|
|
633
|
+
.shadow().find("udex-list-item").shadow().find("[part=item]")
|
|
634
|
+
.should("have.attr", "aria-posinset", "1").and("have.attr", "aria-setsize", "2");
|
|
635
|
+
cy.get("[udex-filter-menu]").shadow().find("udex-list-group-header").eq(1)
|
|
636
|
+
.shadow().find("udex-list-item").shadow().find("[part=item]")
|
|
637
|
+
.should("have.attr", "aria-posinset", "2").and("have.attr", "aria-setsize", "2");
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
|
|
579
641
|
describe("Filter Menu Single with search", () => {
|
|
580
642
|
beforeEach(() => {
|
|
581
643
|
cy.mount(filterMenuSingleWithSearch);
|
|
@@ -1597,6 +1659,16 @@ describe("Filter Menu component", () => {
|
|
|
1597
1659
|
.find(".udex-list__group-list__content [role=listbox]").should("not.exist");
|
|
1598
1660
|
});
|
|
1599
1661
|
|
|
1662
|
+
it("content region (role=\"group\") is a sibling of the header list-item, not nested in its subtree slot", () => {
|
|
1663
|
+
// Sibling-group structure: the content region is emitted alongside the
|
|
1664
|
+
// header list-item inside .udex-list__group-list, and the header item
|
|
1665
|
+
// carries no _subtree marker (no nested composition).
|
|
1666
|
+
|
|
1667
|
+
cy.get("#filter-menu-tree-collapsible").shadow()
|
|
1668
|
+
.find("udex-list-group-header").shadow()
|
|
1669
|
+
.find(".udex-list__group-list > .udex-list__group-list__content[role='group']").should("exist");
|
|
1670
|
+
});
|
|
1671
|
+
|
|
1600
1672
|
// Updated: host udex-list-item has role="none"; the treeitem role is set via
|
|
1601
1673
|
// accessible-role on the host (which the template renders onto [part=item]).
|
|
1602
1674
|
it("child items get accessible-role=\"treeitem\" on their host element", () => {
|
|
@@ -1687,10 +1759,28 @@ describe("Filter Menu component", () => {
|
|
|
1687
1759
|
.find("#udex-list").should("have.attr", "role", "tree");
|
|
1688
1760
|
});
|
|
1689
1761
|
|
|
1690
|
-
it("non-collapsible group's list container
|
|
1762
|
+
it("non-collapsible group's list container is transparent (role=\"none\") in tree mode so the header sits at the top level", () => {
|
|
1691
1763
|
cy.get("#filter-menu-tree-non-collapsible").shadow()
|
|
1692
1764
|
.find("udex-list-group-header").shadow()
|
|
1693
|
-
.find(".udex-list__group-list").should("have.attr", "role", "
|
|
1765
|
+
.find(".udex-list__group-list").should("have.attr", "role", "none");
|
|
1766
|
+
});
|
|
1767
|
+
|
|
1768
|
+
it("children are wrapped in a nested role=\"group\" that sits as a sibling of the header treeitem", () => {
|
|
1769
|
+
// Sibling-group structure: the role="group" container is emitted alongside
|
|
1770
|
+
// the header inside .udex-list__group-list; the header item is not composed
|
|
1771
|
+
// into a subtree slot.
|
|
1772
|
+
cy.get("#filter-menu-tree-non-collapsible").shadow()
|
|
1773
|
+
.find("udex-list-group-header").shadow()
|
|
1774
|
+
.find(".udex-list__group-list > [role='group']").should("exist");
|
|
1775
|
+
|
|
1776
|
+
cy.get("#filter-menu-tree-non-collapsible").shadow()
|
|
1777
|
+
.find("udex-list-group-header").shadow()
|
|
1778
|
+
.find("udex-list-item").should("not.have.attr", "_subtree");
|
|
1779
|
+
|
|
1780
|
+
cy.get("#filter-menu-tree-non-collapsible").shadow()
|
|
1781
|
+
.find("udex-list-group-header").shadow()
|
|
1782
|
+
.find("udex-list-item").shadow()
|
|
1783
|
+
.find("[part=item] slot[name='subtree']").should("not.exist");
|
|
1694
1784
|
});
|
|
1695
1785
|
|
|
1696
1786
|
it("non-collapsible active header's inner udex-list-item has accessible-role=\"treeitem\"", () => {
|
|
@@ -1707,6 +1797,8 @@ describe("Filter Menu component", () => {
|
|
|
1707
1797
|
.should("have.attr", "role", "treeitem")
|
|
1708
1798
|
.and("have.attr", "aria-checked", "false");
|
|
1709
1799
|
});
|
|
1800
|
+
|
|
1801
|
+
|
|
1710
1802
|
});
|
|
1711
1803
|
|
|
1712
1804
|
describe("Non-interactive group header in tree mode", () => {
|
|
@@ -1799,6 +1891,69 @@ describe("Filter Menu component", () => {
|
|
|
1799
1891
|
.should("have.attr", "role", "treeitem");
|
|
1800
1892
|
});
|
|
1801
1893
|
|
|
1894
|
+
it("nests the content region (role=\"group\") inside the treeitem div (conformant tree)", () => {
|
|
1895
|
+
// Conformant nesting: the role="group" content region is a DESCENDANT of the
|
|
1896
|
+
// .udex-list__group-content treeitem, so screen readers count children per group
|
|
1897
|
+
// natively (no author aria-posinset needed — matches the List component). This is
|
|
1898
|
+
// what restores JAWS per-item counting under arrow navigation.
|
|
1899
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1900
|
+
.find("udex-list-group-header").shadow()
|
|
1901
|
+
.find(".udex-list__group-list > .udex-list__group-content--nested[role='treeitem']").should("exist");
|
|
1902
|
+
|
|
1903
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1904
|
+
.find("udex-list-group-header").shadow()
|
|
1905
|
+
.find(".udex-list__group-content--nested[role='treeitem'] .udex-list__group-list__content[role='group']").should("exist");
|
|
1906
|
+
|
|
1907
|
+
// The content region is no longer emitted as a sibling of the treeitem.
|
|
1908
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1909
|
+
.find("udex-list-group-header").shadow()
|
|
1910
|
+
.find(".udex-list__group-list > .udex-list__group-list__content[role='group']").should("not.exist");
|
|
1911
|
+
|
|
1912
|
+
// The visible header row wrapper now sits inside the treeitem (ring/layout target).
|
|
1913
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1914
|
+
.find("udex-list-group-header").shadow()
|
|
1915
|
+
.find(".udex-list__group-content--nested[role='treeitem'] > .udex-list__group-header-row").should("exist");
|
|
1916
|
+
});
|
|
1917
|
+
|
|
1918
|
+
it("emits explicit aria-posinset/aria-setsize on single-select child treeitems (forces JAWS re-announcement)", () => {
|
|
1919
|
+
// Conformant nesting makes the structural count match the explicit values, so
|
|
1920
|
+
// JAWS trusts and re-announces on every arrow step — not just on group entry.
|
|
1921
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1922
|
+
.find("udex-list-group-header")
|
|
1923
|
+
.find("udex-list-item").eq(0).shadow()
|
|
1924
|
+
.find("[part=item]").should("have.attr", "aria-posinset", "1");
|
|
1925
|
+
|
|
1926
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1927
|
+
.find("udex-list-group-header")
|
|
1928
|
+
.find("udex-list-item").eq(0).shadow()
|
|
1929
|
+
.find("[part=item]").should("have.attr", "aria-setsize");
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
it("group header div does NOT render a -treeposition describedby node", () => {
|
|
1934
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1935
|
+
.find("udex-list-group-header").shadow()
|
|
1936
|
+
.find("[id$=-treeposition]").should("not.exist");
|
|
1937
|
+
|
|
1938
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1939
|
+
.find("udex-list-group-header").shadow()
|
|
1940
|
+
.find(".udex-list__group-content")
|
|
1941
|
+
.should("not.have.attr", "aria-describedby");
|
|
1942
|
+
});
|
|
1943
|
+
|
|
1944
|
+
// The chevron button inside the collapsible header carries an "Expand"/"Collapse"
|
|
1945
|
+
// accessible-name (a mouse affordance). Without an explicit aria-labelledby, that
|
|
1946
|
+
// label folds into the treeitem's computed name, so VoiceOver announces the state
|
|
1947
|
+
// twice ("… Collapse … expanded"). Pinning the name to the heading (+ supporting
|
|
1948
|
+
// text) keeps the chevron's label out; aria-expanded still conveys the state.
|
|
1949
|
+
it("group header div pins its accessible name to the heading (excludes the chevron's label)", () => {
|
|
1950
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1951
|
+
.find("udex-list-group-header").shadow()
|
|
1952
|
+
.find(".udex-list__group-content")
|
|
1953
|
+
.should("have.attr", "aria-labelledby")
|
|
1954
|
+
.and("match", /^group-heading/);
|
|
1955
|
+
});
|
|
1956
|
+
|
|
1802
1957
|
it("group header div has aria-expanded=\"true\" when expanded (default)", () => {
|
|
1803
1958
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1804
1959
|
.find("udex-list-group-header").shadow()
|
|
@@ -1923,7 +2078,7 @@ describe("Filter Menu component", () => {
|
|
|
1923
2078
|
it("clicking the header body does NOT select any child", () => {
|
|
1924
2079
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1925
2080
|
.find("udex-list-group-header").shadow()
|
|
1926
|
-
.find(".udex-list__group-
|
|
2081
|
+
.find(".udex-list__group-header-row").click();
|
|
1927
2082
|
|
|
1928
2083
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
1929
2084
|
.find("udex-list-group-header")
|
|
@@ -2000,6 +2155,16 @@ describe("Filter Menu component", () => {
|
|
|
2000
2155
|
.find("udex-list-group-header").shadow()
|
|
2001
2156
|
.find(".udex-list__group-content");
|
|
2002
2157
|
|
|
2158
|
+
// The visible header body. In the conformant nested tree the treeitem div
|
|
2159
|
+
// (.udex-list__group-content) wraps the whole subtree, so its geometric centre is
|
|
2160
|
+
// over a child item — clicking it is "covered". The header row is the actual body
|
|
2161
|
+
// (it sits above the children), so clicks target it while attribute assertions stay
|
|
2162
|
+
// on the treeitem div above.
|
|
2163
|
+
const headerRow = () =>
|
|
2164
|
+
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
2165
|
+
.find("udex-list-group-header").shadow()
|
|
2166
|
+
.find(".udex-list__group-header-row");
|
|
2167
|
+
|
|
2003
2168
|
const arrowButton = () =>
|
|
2004
2169
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
2005
2170
|
.find("udex-list-group-header").shadow()
|
|
@@ -2020,14 +2185,14 @@ describe("Filter Menu component", () => {
|
|
|
2020
2185
|
headerDiv().should("not.have.attr", "aria-selected");
|
|
2021
2186
|
headerDiv().should("not.have.attr", "aria-checked");
|
|
2022
2187
|
|
|
2023
|
-
|
|
2188
|
+
headerRow().click();
|
|
2024
2189
|
|
|
2025
2190
|
headerDiv().should("not.have.attr", "aria-selected");
|
|
2026
2191
|
headerDiv().should("not.have.attr", "aria-checked");
|
|
2027
2192
|
});
|
|
2028
2193
|
|
|
2029
2194
|
it("clicking the header body does NOT set the selected property on the host group header", () => {
|
|
2030
|
-
|
|
2195
|
+
headerRow().click();
|
|
2031
2196
|
|
|
2032
2197
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
2033
2198
|
.find("udex-list-group-header").then($gh => {
|
|
@@ -2036,7 +2201,7 @@ describe("Filter Menu component", () => {
|
|
|
2036
2201
|
});
|
|
2037
2202
|
|
|
2038
2203
|
it("clicking the header body does NOT select any child item", () => {
|
|
2039
|
-
|
|
2204
|
+
headerRow().click();
|
|
2040
2205
|
|
|
2041
2206
|
childItems().each($item => {
|
|
2042
2207
|
cy.wrap($item).shadow()
|
|
@@ -2049,7 +2214,7 @@ describe("Filter Menu component", () => {
|
|
|
2049
2214
|
it("clicking the header body does NOT collapse the group", () => {
|
|
2050
2215
|
headerDiv().should("have.attr", "aria-expanded", "true");
|
|
2051
2216
|
|
|
2052
|
-
|
|
2217
|
+
headerRow().click();
|
|
2053
2218
|
|
|
2054
2219
|
headerDiv().should("have.attr", "aria-expanded", "true");
|
|
2055
2220
|
cy.get("#filter-menu-single-tree-collapsible").shadow()
|
|
@@ -2143,24 +2308,49 @@ describe("Filter Menu component", () => {
|
|
|
2143
2308
|
.find("[udex-list]").should("not.have.attr", "aria-multiselectable");
|
|
2144
2309
|
});
|
|
2145
2310
|
|
|
2146
|
-
//
|
|
2147
|
-
//
|
|
2148
|
-
//
|
|
2149
|
-
//
|
|
2150
|
-
|
|
2311
|
+
// Per-group-listbox pattern: JAWS ignores role="group" boundaries and author
|
|
2312
|
+
// aria-posinset within a single listbox (it read the flat total "1 of 8" instead of
|
|
2313
|
+
// "1 of 4"), but counts options natively within a flat listbox. So each group becomes
|
|
2314
|
+
// its own role="listbox" and the outer #udex-list drops its listbox role (it would
|
|
2315
|
+
// otherwise be an invalid nested listbox). Not a tree.
|
|
2316
|
+
it("inner list div is presentational (role=\"presentation\"), not listbox or tree", () => {
|
|
2151
2317
|
cy.get("#filter-menu-single-group").shadow()
|
|
2152
2318
|
.find("[udex-list]").shadow()
|
|
2153
|
-
.find("#udex-list")
|
|
2319
|
+
.find("#udex-list")
|
|
2320
|
+
.should("have.attr", "role", "presentation");
|
|
2321
|
+
});
|
|
2322
|
+
|
|
2323
|
+
it("each group renders its own role=\"listbox\" labelled by its heading", () => {
|
|
2324
|
+
cy.get("#filter-menu-single-group").shadow()
|
|
2325
|
+
.find("udex-list-group-header").shadow()
|
|
2326
|
+
.find("[role=listbox]")
|
|
2327
|
+
.should("have.attr", "aria-labelledby", "group-heading");
|
|
2154
2328
|
});
|
|
2155
2329
|
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2330
|
+
it("the outer group wrapper is transparent (role=\"none\") so the label is not announced twice", () => {
|
|
2331
|
+
cy.get("#filter-menu-single-group").shadow()
|
|
2332
|
+
.find("udex-list-group-header").shadow()
|
|
2333
|
+
.find(".udex-list__group")
|
|
2334
|
+
.should("have.attr", "role", "none")
|
|
2335
|
+
.and("not.have.attr", "aria-labelledby");
|
|
2336
|
+
});
|
|
2337
|
+
|
|
2338
|
+
it("group child items have role=\"option\" (inside the per-group listbox), not treeitem", () => {
|
|
2339
|
+
cy.get("#filter-menu-single-group").shadow()
|
|
2340
|
+
.find("udex-list-group-header")
|
|
2341
|
+
.find("udex-list-item").eq(0).shadow()
|
|
2342
|
+
.find("[part=item]")
|
|
2343
|
+
.should("have.attr", "role", "option")
|
|
2344
|
+
.and("not.have.attr", "role", "treeitem");
|
|
2345
|
+
});
|
|
2346
|
+
|
|
2347
|
+
// The group header host stays role="none" (transparent). The widget role now lives on
|
|
2348
|
+
// the inner per-group role="listbox" (asserted above), not on the host or the outer
|
|
2349
|
+
// div.udex-list__group, so the heading is announced once.
|
|
2350
|
+
it("group header host has role=\"none\" and no _tree-mode attribute", () => {
|
|
2161
2351
|
cy.get("#filter-menu-single-group").shadow()
|
|
2162
2352
|
.find("udex-list-group-header")
|
|
2163
|
-
.should("have.attr", "role", "
|
|
2353
|
+
.should("have.attr", "role", "none")
|
|
2164
2354
|
.and("not.have.attr", "_tree-mode");
|
|
2165
2355
|
});
|
|
2166
2356
|
|
|
@@ -45,8 +45,10 @@ const collapsibleListRadioGroup = <UDExList id="list-group-header-collapsible" m
|
|
|
45
45
|
</UDExList>;
|
|
46
46
|
|
|
47
47
|
// Regression fixture: grouped MultiSelect list WITHOUT any collapsible group header.
|
|
48
|
-
// This
|
|
49
|
-
//
|
|
48
|
+
// This stays on the listbox pattern (role="listbox", items role="option") because
|
|
49
|
+
// _hasCollapsibleGroups is false — it does NOT enter the tree pattern. As a
|
|
50
|
+
// MultiSelect listbox it still exposes aria-multiselectable="true" so each option's
|
|
51
|
+
// aria-selected state is announced.
|
|
50
52
|
const nonCollapsibleList = <UDExList id="list-group-header-non-collapsible" mode="MultiSelect">
|
|
51
53
|
<UDExListGroupHeader id="group-header-non-collapsible" supporting-text="Supporting text" label="Group Header">
|
|
52
54
|
<UDExListItem>List Item1</UDExListItem>
|
|
@@ -344,6 +346,14 @@ describe("List - collapsible group header uses tree pattern", () => {
|
|
|
344
346
|
.and("have.attr", "aria-expanded", "true");
|
|
345
347
|
});
|
|
346
348
|
|
|
349
|
+
it("MultiSelect collapsible header: renders the role=\"group\" content region as a sibling of the header (not nested in the item)", () => {
|
|
350
|
+
cy.mount(collapsibleList);
|
|
351
|
+
cy.get("#group-header-collapsible").shadow()
|
|
352
|
+
.find("udex-list-item").should("not.have.attr", "_subtree");
|
|
353
|
+
cy.get("#group-header-collapsible").shadow()
|
|
354
|
+
.find(".udex-list__group-list > .udex-list__group-list__content[role='group']").should("exist");
|
|
355
|
+
});
|
|
356
|
+
|
|
347
357
|
it("SingleSelect collapsible header: plain div gets role=\"treeitem\"", () => {
|
|
348
358
|
cy.mount(collapsibleListSingleSelect);
|
|
349
359
|
// SingleSelect => useListItemHeader=false => plain .udex-list__group-content <div>,
|
|
@@ -352,6 +362,20 @@ describe("List - collapsible group header uses tree pattern", () => {
|
|
|
352
362
|
.find(".udex-list__group-content").should("have.attr", "role", "treeitem");
|
|
353
363
|
});
|
|
354
364
|
|
|
365
|
+
it("SingleSelect collapsible header: nests the role=\"group\" content region inside the treeitem (conformant tree)", () => {
|
|
366
|
+
cy.mount(collapsibleListSingleSelect);
|
|
367
|
+
cy.get("#group-header-collapsible").shadow()
|
|
368
|
+
.find(".udex-list__group-list > .udex-list__group-content--nested[role='treeitem']").should("exist");
|
|
369
|
+
// The content region is a descendant of the treeitem, not a sibling.
|
|
370
|
+
cy.get("#group-header-collapsible").shadow()
|
|
371
|
+
.find(".udex-list__group-content--nested[role='treeitem'] .udex-list__group-list__content[role='group']").should("exist");
|
|
372
|
+
cy.get("#group-header-collapsible").shadow()
|
|
373
|
+
.find(".udex-list__group-list > .udex-list__group-list__content[role='group']").should("not.exist");
|
|
374
|
+
// The visible header row wrapper now sits inside the treeitem.
|
|
375
|
+
cy.get("#group-header-collapsible").shadow()
|
|
376
|
+
.find(".udex-list__group-content--nested[role='treeitem'] > .udex-list__group-header-row").should("exist");
|
|
377
|
+
});
|
|
378
|
+
|
|
355
379
|
it("child items expose accessible-role=\"treeitem\" on the host", () => {
|
|
356
380
|
cy.mount(collapsibleList);
|
|
357
381
|
cy.get("#group-header-collapsible").find("udex-list-item")
|
|
@@ -372,9 +396,9 @@ describe("List - collapsible group header uses tree pattern", () => {
|
|
|
372
396
|
innerList().should("have.attr", "role", "listbox");
|
|
373
397
|
});
|
|
374
398
|
|
|
375
|
-
it("non-collapsible
|
|
399
|
+
it("non-collapsible MultiSelect list exposes aria-multiselectable=\"true\" but stays out of tree mode", () => {
|
|
376
400
|
cy.mount(nonCollapsibleList);
|
|
377
|
-
innerList().should("
|
|
401
|
+
innerList().should("have.attr", "aria-multiselectable", "true");
|
|
378
402
|
cy.get("#group-header-non-collapsible").should("not.have.attr", "_tree-mode");
|
|
379
403
|
});
|
|
380
404
|
|
|
@@ -385,6 +409,45 @@ describe("List - collapsible group header uses tree pattern", () => {
|
|
|
385
409
|
});
|
|
386
410
|
});
|
|
387
411
|
|
|
412
|
+
// Added: flat MultiSelect list follows the WAI-ARIA multi-select listbox pattern —
|
|
413
|
+
// the listbox is aria-multiselectable and each option carries aria-selected (instead
|
|
414
|
+
// of relying on the decorative checkbox for state). This makes the screen reader
|
|
415
|
+
// announce the selected/not-selected state ONCE (no duplicate from the checkbox) and,
|
|
416
|
+
// crucially, re-announce it when Enter/Space toggles the focused option.
|
|
417
|
+
describe("List - flat MultiSelect selection announcement", () => {
|
|
418
|
+
const flatMultiSelect = (
|
|
419
|
+
<UDExList id="flat-multi" mode="MultiSelect">
|
|
420
|
+
<UDExListItem id="flat-multi-item-1">List Item1</UDExListItem>
|
|
421
|
+
<UDExListItem id="flat-multi-item-2">List Item2</UDExListItem>
|
|
422
|
+
</UDExList>
|
|
423
|
+
);
|
|
424
|
+
|
|
425
|
+
it("options expose aria-selected and the checkbox is aria-hidden (no double state announcement)", () => {
|
|
426
|
+
cy.mount(flatMultiSelect);
|
|
427
|
+
|
|
428
|
+
cy.get("#flat-multi-item-1").shadow().find("[part=item]")
|
|
429
|
+
.should("have.attr", "role", "option")
|
|
430
|
+
.and("have.attr", "aria-selected", "false");
|
|
431
|
+
cy.get("#flat-multi-item-1").shadow().find("udex-checkbox")
|
|
432
|
+
.should("have.attr", "aria-hidden");
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it("Enter on a focused option flips its aria-selected (state change is announced)", () => {
|
|
436
|
+
cy.mount(flatMultiSelect);
|
|
437
|
+
|
|
438
|
+
cy.get("#flat-multi-item-1").shadow().find("[part=item]").focus();
|
|
439
|
+
cy.realPress("Enter");
|
|
440
|
+
|
|
441
|
+
cy.get("#flat-multi-item-1").shadow().find("[part=item]")
|
|
442
|
+
.should("have.attr", "aria-selected", "true");
|
|
443
|
+
|
|
444
|
+
cy.realPress("Enter");
|
|
445
|
+
|
|
446
|
+
cy.get("#flat-multi-item-1").shadow().find("[part=item]")
|
|
447
|
+
.should("have.attr", "aria-selected", "false");
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
|
|
388
451
|
describe("List component - SingleContent accessible name", () => {
|
|
389
452
|
it("uses accessible-name as aria-label when only accessible-name is set", () => {
|
|
390
453
|
cy.mount(
|
|
@@ -222,9 +222,11 @@ describe("ListItem", () => {
|
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
// Added: unit-level coverage for the WCAG 4.1.2 Treeview Checkbox pattern
|
|
226
|
-
// (ariaCheckedValue
|
|
227
|
-
//
|
|
225
|
+
// Added: unit-level coverage for the WCAG 4.1.2 Treeview Checkbox pattern getter
|
|
226
|
+
// (ariaCheckedValue). It only activates when the item's accessible-role ===
|
|
227
|
+
// "treeitem" (set by SearchableListBase in the tree pattern). The inner checkbox
|
|
228
|
+
// is always aria-hidden in MultiSelect (a visual affordance only) — state is
|
|
229
|
+
// announced by the item's own aria-checked (tree) / aria-selected (flat option).
|
|
228
230
|
describe("Tree accessibility pattern (accessible-role=\"treeitem\")", () => {
|
|
229
231
|
it("[part=item] has role=\"treeitem\" and aria-checked=\"false\" when unselected", () => {
|
|
230
232
|
cy.mount(<UDExListItem
|
|
@@ -439,9 +441,11 @@ describe("ListItem", () => {
|
|
|
439
441
|
.find("[part=item]").should("have.attr", "aria-selected", "true");
|
|
440
442
|
});
|
|
441
443
|
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
|
|
444
|
+
// Updated: a SingleSelect option (default listbox role) now also exposes
|
|
445
|
+
// aria-selected so the screen reader announces its selected state natively.
|
|
446
|
+
// Previously options relied on a describedby state string, which made
|
|
447
|
+
// VoiceOver announce a phantom "selected" for every focused option.
|
|
448
|
+
it("SingleSelect default option exposes aria-selected", () => {
|
|
445
449
|
cy.mount(<UDExListItem
|
|
446
450
|
id="single-opt-item"
|
|
447
451
|
mode={UDExListMode.SingleSelect}
|
|
@@ -450,7 +454,9 @@ describe("ListItem", () => {
|
|
|
450
454
|
</UDExListItem>);
|
|
451
455
|
|
|
452
456
|
cy.get("#single-opt-item").shadow()
|
|
453
|
-
.find("[part=item]")
|
|
457
|
+
.find("[part=item]")
|
|
458
|
+
.should("have.attr", "role", "option")
|
|
459
|
+
.and("have.attr", "aria-selected", "true");
|
|
454
460
|
});
|
|
455
461
|
});
|
|
456
462
|
|
|
@@ -485,7 +491,7 @@ describe("ListItem", () => {
|
|
|
485
491
|
.find("[part=item]").should("not.have.attr", "aria-checked");
|
|
486
492
|
});
|
|
487
493
|
|
|
488
|
-
it("inner udex-checkbox is
|
|
494
|
+
it("inner udex-checkbox is aria-hidden in flat MultiSelect (state announced via the option's aria-selected)", () => {
|
|
489
495
|
cy.mount(<UDExListItem
|
|
490
496
|
id="opt-item-checkbox"
|
|
491
497
|
mode={UDExListMode.MultiSelect}
|
|
@@ -493,7 +499,27 @@ describe("ListItem", () => {
|
|
|
493
499
|
</UDExListItem>);
|
|
494
500
|
|
|
495
501
|
cy.get("#opt-item-checkbox").shadow()
|
|
496
|
-
.find("udex-checkbox").should("
|
|
502
|
+
.find("udex-checkbox").should("have.attr", "aria-hidden");
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("MultiSelect option exposes aria-selected reflecting selection (unselected -> selected)", () => {
|
|
506
|
+
cy.mount(<UDExListItem
|
|
507
|
+
id="opt-item-selected"
|
|
508
|
+
mode={UDExListMode.MultiSelect}
|
|
509
|
+
label="JavaScript">
|
|
510
|
+
</UDExListItem>);
|
|
511
|
+
|
|
512
|
+
cy.get("#opt-item-selected").shadow()
|
|
513
|
+
.find("[part=item]")
|
|
514
|
+
.should("have.attr", "role", "option")
|
|
515
|
+
.and("have.attr", "aria-selected", "false");
|
|
516
|
+
|
|
517
|
+
cy.get("#opt-item-selected").then($el => {
|
|
518
|
+
($el[0] as UDExListItem).selected = true;
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
cy.get("#opt-item-selected").shadow()
|
|
522
|
+
.find("[part=item]").should("have.attr", "aria-selected", "true");
|
|
497
523
|
});
|
|
498
524
|
|
|
499
525
|
it("explicit non-tree accessible-role (e.g. \"option\") still suppresses aria-checked", () => {
|
|
@@ -768,6 +768,25 @@ describe("SelectBox", () => {
|
|
|
768
768
|
.should("have.attr", "_active-descendant");
|
|
769
769
|
});
|
|
770
770
|
|
|
771
|
+
it("MultiSelect collapsible group keeps the host-aria sibling layout (no structural nesting)", () => {
|
|
772
|
+
cy.mount(groupHeaderCollapsible);
|
|
773
|
+
|
|
774
|
+
cy.get("#select-box").shadow().find(".udex-text-field__search").click();
|
|
775
|
+
|
|
776
|
+
// Fix 18 regression guard: SelectBox uses the aria-activedescendant model, so a
|
|
777
|
+
// collapsible group header must NOT structurally nest its items (fix 16 nesting is
|
|
778
|
+
// for the real-DOM-focus tree components only). Nesting would reflow the header
|
|
779
|
+
// container to wrap its items and spread the header focus ring over the whole group.
|
|
780
|
+
// The header's inner list-item must not own a subtree, and the items must remain in
|
|
781
|
+
// the sibling content region.
|
|
782
|
+
|
|
783
|
+
cy.get("#select-box").shadow()
|
|
784
|
+
.find("udex-list-group-header").first()
|
|
785
|
+
.shadow()
|
|
786
|
+
.find(".udex-list__group-list__content")
|
|
787
|
+
.should("exist");
|
|
788
|
+
});
|
|
789
|
+
|
|
771
790
|
it("MultiSelect mode - Left arrow collapses a collapsible group header, Right arrow expands it", () => {
|
|
772
791
|
cy.mount(groupHeaderCollapsible);
|
|
773
792
|
|
|
@@ -2530,6 +2549,23 @@ describe("SelectBox", () => {
|
|
|
2530
2549
|
.should("be.greaterThan", 0);
|
|
2531
2550
|
});
|
|
2532
2551
|
|
|
2552
|
+
it("SingleSelect collapsible group keeps the host-aria sibling layout (no structural nesting)", () => {
|
|
2553
|
+
cy.mount(groupHeaderCollapsibleSingleSelect);
|
|
2554
|
+
cy.get("#select-box").shadow().find(".udex-text-field__trigger").click();
|
|
2555
|
+
|
|
2556
|
+
cy.get("#select-box").shadow()
|
|
2557
|
+
.find("udex-list-group-header").first()
|
|
2558
|
+
.shadow()
|
|
2559
|
+
.find(".udex-list__group-list__content")
|
|
2560
|
+
.should("exist");
|
|
2561
|
+
|
|
2562
|
+
cy.get("#select-box").shadow()
|
|
2563
|
+
.find("udex-list-group-header").first()
|
|
2564
|
+
.shadow()
|
|
2565
|
+
.find(".udex-list__group-content")
|
|
2566
|
+
.should("not.have.class", "udex-list__group-content--nested");
|
|
2567
|
+
});
|
|
2568
|
+
|
|
2533
2569
|
const collapsedGroupWithSelectionFixture = <div style="width: 350px; position:relative;">
|
|
2534
2570
|
<UDExSelectBox id="select-box" height="200px" label="Languages">
|
|
2535
2571
|
<UDExSelectBoxGroupHeader label="Backend Languages" collapsible collapsed>
|
|
@@ -2595,6 +2631,70 @@ describe("SelectBox", () => {
|
|
|
2595
2631
|
});
|
|
2596
2632
|
});
|
|
2597
2633
|
|
|
2634
|
+
describe("SingleSelect collapsible group headers", () => {
|
|
2635
|
+
// Two collapsible groups; the second sits below the fold so its chevron is a
|
|
2636
|
+
// "lower" header (the failing case in the original bug). No pre-selection needed.
|
|
2637
|
+
const twoCollapsibleGroupsFixture = <div style="width: 350px; position:relative;">
|
|
2638
|
+
<UDExSelectBox id="select-box" height="200px" label="Languages">
|
|
2639
|
+
<UDExSelectBoxGroupHeader label="Backend Languages" collapsible>
|
|
2640
|
+
<UDExSelectBoxItem label="Java"></UDExSelectBoxItem>
|
|
2641
|
+
<UDExSelectBoxItem label="Python"></UDExSelectBoxItem>
|
|
2642
|
+
<UDExSelectBoxItem label="Go"></UDExSelectBoxItem>
|
|
2643
|
+
<UDExSelectBoxItem label="Ruby"></UDExSelectBoxItem>
|
|
2644
|
+
<UDExSelectBoxItem label="Rust"></UDExSelectBoxItem>
|
|
2645
|
+
</UDExSelectBoxGroupHeader>
|
|
2646
|
+
<UDExSelectBoxGroupHeader label="Frontend Languages" collapsible>
|
|
2647
|
+
<UDExSelectBoxItem label="JavaScript"></UDExSelectBoxItem>
|
|
2648
|
+
<UDExSelectBoxItem label="TypeScript"></UDExSelectBoxItem>
|
|
2649
|
+
</UDExSelectBoxGroupHeader>
|
|
2650
|
+
</UDExSelectBox>
|
|
2651
|
+
</div>;
|
|
2652
|
+
|
|
2653
|
+
it("collapses a lower group header on a single chevron click (no focus-steal double click)", () => {
|
|
2654
|
+
cy.mount(twoCollapsibleGroupsFixture);
|
|
2655
|
+
cy.get("#select-box").shadow().find(".udex-text-field__trigger").click();
|
|
2656
|
+
cy.get("#select-box").shadow().find(".udex-select-box__dropdown").should("have.attr", "open");
|
|
2657
|
+
|
|
2658
|
+
// The second (lower) group starts expanded.
|
|
2659
|
+
cy.get("#select-box").shadow()
|
|
2660
|
+
.find("[udex-list-group-header]").eq(1)
|
|
2661
|
+
.should("not.have.attr", "collapsed");
|
|
2662
|
+
|
|
2663
|
+
// A single click on its chevron must collapse it. Previously DOM focus jumped to
|
|
2664
|
+
// the header body div, triggering a focusout→refocus + scroll-into-view that shifted
|
|
2665
|
+
// the chevron and ate the first click, so the group only collapsed on the second.
|
|
2666
|
+
cy.get("#select-box").shadow()
|
|
2667
|
+
.find("[udex-list-group-header]").eq(1).shadow()
|
|
2668
|
+
.find(".udex-list__group-heading__icon").click();
|
|
2669
|
+
|
|
2670
|
+
cy.get("#select-box").shadow()
|
|
2671
|
+
.find("[udex-list-group-header]").eq(1)
|
|
2672
|
+
.should("have.attr", "collapsed");
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
it("Enter on a group header does not select its items", () => {
|
|
2676
|
+
cy.mount(groupHeaderCollapsibleSingleSelect);
|
|
2677
|
+
cy.get("#select-box").shadow().find(".udex-text-field__search").click();
|
|
2678
|
+
cy.realPress("ArrowDown");
|
|
2679
|
+
|
|
2680
|
+
// The collapsible group header is the active descendant (DOM focus stays on input).
|
|
2681
|
+
cy.get("#select-box").shadow()
|
|
2682
|
+
.find("udex-list-group-header")
|
|
2683
|
+
.should("have.attr", "_active-descendant");
|
|
2684
|
+
|
|
2685
|
+
cy.realPress("Enter");
|
|
2686
|
+
|
|
2687
|
+
// A SingleSelect group header is not a selectable option: Enter must select nothing.
|
|
2688
|
+
cy.get("[udex-select-box-item]").each($item => {
|
|
2689
|
+
cy.wrap($item).should("not.have.attr", "selected");
|
|
2690
|
+
});
|
|
2691
|
+
|
|
2692
|
+
// The dropdown stays open (Enter did not commit a selection or close it).
|
|
2693
|
+
cy.get("#select-box").shadow()
|
|
2694
|
+
.find(".udex-select-box__dropdown").should("have.attr", "open");
|
|
2695
|
+
});
|
|
2696
|
+
});
|
|
2697
|
+
|
|
2598
2698
|
// Tree accessibility pattern: SelectBox uses tree pattern when group headers are present.
|
|
2599
2699
|
describe("Tree accessibility pattern with group headers", () => {
|
|
2600
2700
|
const selectBoxMultiSelectGroup = <div style="width: 350px; position:relative;">
|