Skip to content

Commit 2cb5652

Browse files
committed
test: fix failures from link changes
1 parent 7a751ad commit 2cb5652

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

packages/react/src/TopicTag/TopicTag.test.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ import {TopicTag} from '../TopicTag'
55

66
describe('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

packages/react/src/TopicTag/TopicTagGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import classes from './TopicTagGroup.module.css'
44

55
type 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
)

0 commit comments

Comments
 (0)