File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
packages/react/src/TopicTag Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,9 @@ import {TopicTag} from '../TopicTag'
55
66describe ( 'TopicTag' , ( ) => {
77 test ( 'defaults to <a> semantics' , async ( ) => {
8- const onClick = vi . fn ( )
9- render (
10- < TopicTag href = "/test" onClick = { onClick } >
11- test
12- </ TopicTag > ,
13- )
8+ render ( < TopicTag href = "#" > test</ TopicTag > )
149
15- await userEvent . click ( screen . getByRole ( 'link' , { name : 'test' } ) )
16- expect ( onClick ) . toHaveBeenCalled ( )
10+ expect ( screen . getByRole ( 'link' , { name : 'test' } ) ) . toBeInTheDocument ( )
1711 } )
1812
1913 test ( 'support <button> semantics through `as` prop' , async ( ) => {
@@ -24,7 +18,7 @@ describe('TopicTag', () => {
2418 </ TopicTag > ,
2519 )
2620
27- await userEvent . click ( screen . getByRole ( 'link ' , { name : 'test' } ) )
21+ await userEvent . click ( screen . getByRole ( 'button ' , { name : 'test' } ) )
2822 expect ( onClick ) . toHaveBeenCalled ( )
2923 } )
3024
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import classes from './TopicTagGroup.module.css'
44
55type TopicTagGroupProps = React . HTMLAttributes < HTMLElement >
66
7- function TopicTagGroup ( { children, ...rest } : TopicTagGroupProps ) {
7+ function TopicTagGroup ( { children, className , ...rest } : TopicTagGroupProps ) {
88 return (
9- < div { ...rest } className = { clsx ( classes . TopicTagGroup ) } >
9+ < div { ...rest } className = { clsx ( className , classes . TopicTagGroup ) } >
1010 { children }
1111 </ div >
1212 )
You can’t perform that action at this time.
0 commit comments