import { describe, expect, it } from 'vitest'
import { render } from '@testing-library/react'
import { Card } from './Card'
import { spokenPhraseUntil } from './sr-test-utils'

describe('Card [SR]', () => {
  it('announces the card header text as spoken content', async () => {
    render(
      <Card header="Panel title" footer="Panel action">
        Body content
      </Card>,
    )
    const phrase = await spokenPhraseUntil(document.body, (value) => value.toLowerCase().includes('panel title'))
    expect(phrase.toLowerCase()).toContain('panel title')
  })
})

