diff --git a/frontend/src/components/ui/progress.test.tsx b/frontend/src/components/ui/progress.test.tsx new file mode 100644 index 00000000..d88fb647 --- /dev/null +++ b/frontend/src/components/ui/progress.test.tsx @@ -0,0 +1,21 @@ +import { render, screen } from '@testing-library/react'; +import { describe, it, expect } from 'vitest'; +import { Progress } from './progress'; + +describe('Progress Component', () => { + it('renders correctly with default values', () => { + render(); + const progressbar = screen.getByRole('progressbar'); + expect(progressbar).toBeInTheDocument(); + expect(progressbar).toHaveAttribute('aria-valuemin', '0'); + expect(progressbar).toHaveAttribute('aria-valuemax', '100'); + expect(progressbar).toHaveAttribute('aria-valuenow', '0'); + }); + + it('renders correctly with custom value and max', () => { + render(); + const progressbar = screen.getByRole('progressbar'); + expect(progressbar).toHaveAttribute('aria-valuenow', '50'); + expect(progressbar).toHaveAttribute('aria-valuemax', '200'); + }); +}); diff --git a/frontend/src/components/ui/progress.tsx b/frontend/src/components/ui/progress.tsx index e2a0153e..0e4b547f 100644 --- a/frontend/src/components/ui/progress.tsx +++ b/frontend/src/components/ui/progress.tsx @@ -15,6 +15,10 @@ export const Progress: React.FC = ({ return (