diff options
Diffstat (limited to 'server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx')
-rw-r--r-- | server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx b/server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx index 97f901852d8..5429ccc2a16 100644 --- a/server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/Badge-test.tsx @@ -23,10 +23,14 @@ import { Badge } from '../Badge'; it('renders badge correctly', () => { render(<Badge>foo</Badge>); - expect(screen.getByRole('status')).toBeInTheDocument(); + expect(screen.getByText('foo')).toBeInTheDocument(); }); it('renders counter correctly', () => { - render(<Badge variant="counter">23</Badge>); - expect(screen.getByRole('status')).toHaveAttribute('aria-label', '23'); + render( + <Badge title="This 23" variant="counter"> + 23 + </Badge>, + ); + expect(screen.getByRole('img')).toHaveAccessibleName('This 23'); }); |