import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { expectNoA11yViolations } from '../test/a11y'
import { Meter, Progress } from './Progress'
describe('Progress', () => {
it('exposes the value on a labelled progressbar', () => {
render()
const bar = screen.getByRole('progressbar', { name: 'Exporting' })
expect(bar).toHaveAttribute('aria-valuenow', '40')
expect(bar).toHaveAttribute('aria-valuemax', '100')
expect(screen.getByText('40%')).toBeInTheDocument()
})
it('is indeterminate with value null', () => {
render()
const bar = screen.getByRole('progressbar', { name: 'Preparing' })
expect(bar).not.toHaveAttribute('aria-valuenow')
})
it('formats with a function', () => {
render(