Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import React from 'react'; import { render, screen } from '@testing-library/react'; import { PriorityBadge } from './PriorityBadge'; describe('PriorityBadge', () => { it('renders low priority', () => { render(<PriorityBadge priority="LOW" />); expect(screen.getByText('Low')).toBeInTheDocument(); }); it('renders medium priority', () => { render(<PriorityBadge priority="MEDIUM" />); expect(screen.getByText('Medium')).toBeInTheDocument(); }); it('renders high priority', () => { render(<PriorityBadge priority="HIGH" />); expect(screen.getByText('High')).toBeInTheDocument(); }); it('renders critical priority', () => { render(<PriorityBadge priority="CRITICAL" />); expect(screen.getByText('Critical')).toBeInTheDocument(); }); it('has correct test id', () => { render(<PriorityBadge priority="HIGH" />); expect(screen.getByTestId('priority-badge')).toBeInTheDocument(); }); it('applies custom className', () => { render(<PriorityBadge priority="HIGH" className="custom-class" />); expect(screen.getByTestId('priority-badge')).toHaveClass('custom-class'); }); it('handles unknown priority gracefully', () => { render(<PriorityBadge priority="UNKNOWN" />); expect(screen.getByText('Medium')).toBeInTheDocument(); }); }); |