Web Components with Slots - Accessible Name Test
Test Instructions:
- Open Chrome DevTools (F12)
- Go to the a11yToolbox panel
- Click "Toggle Accessible Names"
- Verify that all custom buttons show their slotted text content as accessible names
Test 1: Simple Slotted Text
A custom button with simple text content passed through a slot:
Expected: Badge should show "Click Me" as the accessible name
Test 2: Slotted Text with Icon
A custom button with text and an icon:
Expected: Badge should show "Search" as the accessible name
Test 3: Named Slot
A custom button with named slot for label:
Expected: Badge should show "Save Changes" as the accessible name
Test 4: Nested Slotted Content
A custom button with nested elements in slot:
Expected: Badge should show "Delete permanently" as the accessible name
Test 5: Fallback Content (No Slotted Content)
A custom button with no slotted content (should use fallback):
Expected: Badge should show "Default Button" as the accessible name