diff --git a/src/radio/RadioGroup.tsx b/src/radio/RadioGroup.tsx index 9032d3532d..9769141680 100644 --- a/src/radio/RadioGroup.tsx +++ b/src/radio/RadioGroup.tsx @@ -86,7 +86,7 @@ const RadioGroup = (props: RadioGroupProps) => { }; const renderOptions = () => { - const Comp = variant.includes('filled') ? Radio.Button : Radio; + const Comp = variant.includes('filled') || variant === 'outline' ? Radio.Button : Radio; return options.map((item) => { let label: ReactNode; let value: string | number; diff --git a/src/radio/__tests__/radio.test.tsx b/src/radio/__tests__/radio.test.tsx index 896ae94d17..bae32f44bb 100644 --- a/src/radio/__tests__/radio.test.tsx +++ b/src/radio/__tests__/radio.test.tsx @@ -81,13 +81,32 @@ describe('RadioGroup', () => { test('variant', () => { const { container } = render( - , + <> + + + + + , ); - expect(container.firstChild.firstChild).toHaveClass('t-radio-button'); + expect(container.firstChild.firstChild).toHaveClass('t-radio'); + for (const item of [...container.children].slice(1)) { + expect(item.firstChild).toHaveClass('t-radio-button'); + } }); test('value is string', () => { diff --git a/test/snap/__snapshots__/csr.test.jsx.snap b/test/snap/__snapshots__/csr.test.jsx.snap index a49e79852f..5af7812bc7 100644 --- a/test/snap/__snapshots__/csr.test.jsx.snap +++ b/test/snap/__snapshots__/csr.test.jsx.snap @@ -49234,42 +49234,42 @@ exports[`csr snapshot test > csr test src/collapse/_example/icon.jsx 1`] = ` class="t-radio-group t-size-m t-radio-group__outline" >