fix(radio-tile): allow standalone RadioTile usage (#2136)

Although `RadioTile` is meant to be used inside a `TileGroup`, it feels  
unpolished for standalone usage to crash due to a missing parent context.

This fixes `RadioTile` to fail open by providing a no-op `add: () => {}`  
when `TileGroup` context is not found.
This commit is contained in:
Eric Liu 2025-03-22 13:03:20 -07:00 committed by GitHub
commit ca9beebaea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -94,8 +94,7 @@ describe("RadioTile", () => {
expect(radioTileLabel).toHaveAttribute("for", "custom-id");
});
// TODO(bug): support standalone radio tile.
it.skip("should handle custom name", () => {
it("should handle custom name", () => {
render(RadioTileSingle);
expect(screen.getByRole("radio")).toHaveAttribute("name", "custom-name");