import React from 'react' import { render, screen } from '@testing-library/react' import { ProgressStepper, type ProgressStepperProps } from './' const defaultArgs = { steps: [ { label: 'Settings', id: 'settings-step' }, { label: 'Questions', id: 'questions-step' }, { label: 'Preview', id: 'preview-step' }, { label: 'Employees', id: 'employees-step' }, { label: 'Schedule', id: 'schedule-step' }, ], } satisfies Pick describe('', () => { it('renders the correct number of steps', () => { render() expect(screen.getAllByRole('listitem').length).toBe(5) }) it('tracks the correct position of the active step', () => { render() screen.getByText('Current: Settings') expect(screen.getByText(`Step 1 of ${defaultArgs.steps.length}`)).toBeInTheDocument() }) it('renders the correct number of completed steps with an accessible name', () => { render() expect(screen.getAllByText('Completed:', { exact: false }).length).toBe(2) }) it('renders the correct number of steps not started with an accessible name', () => { render() expect(screen.getAllByText('Not started:', { exact: false }).length).toBe(2) }) it('renders all steps as complete if the provided the `isComplete` prop', () => { render() expect(screen.getAllByText('Completed:', { exact: false }).length).toBe(5) }) })