Skip to content

[TEST] RadioGroup: roving focus, form value, data-attrs #1491

@kotAPI

Description

@kotAPI

Labels: tests, a11y, component:RadioGroup, priority:medium

Summary
Ensure RadioGroup supports roving focus, controlled/uncontrolled selection, form submission, and data-state attributes.

Acceptance Criteria

Arrow keys move focus and selection; Home/End jump to first/last.

Controlled value prop syncs with onValueChange; defaultValue works.

form submit includes selected value; disabled radios skip focus.

data-state="checked|unchecked"; data-disabled set when disabled.

AXE: no violations; role="radiogroup"/"radio".

asChild radios preserve semantics/refs.

Test Plan (Implementation Notes)
Framework: Jest + React Testing Library
Files: src/components/ui/RadioGroup/tests/RadioGroup.behavior.test.tsx
Helpers: user-event
Edge cases: no default selection, nested groups, RTL
Coverage Targets: ≥80% branch.

Out of Scope
Visual layouts.

Risk
medium – roving focus.

Effort
M

References

src/components/ui/RadioGroup/RadioGroup.tsx

src/components/ui/RadioGroup/tests/RadioGroup.test.tsx

WAI-ARIA radiogroup pattern

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions