Files
2026-05-11 17:46:13 +02:00

31 lines
719 B
TypeScript

import { expect, test } from 'vitest'
test('simple heading', () => {
document.body.innerHTML = `
<h1>Hello World</h1>
<p>Some description</p>
`
expect(document.body).toMatchAriaInlineSnapshot(`
- heading "Hello World" [level=1]
- paragraph: Some description
`)
})
test('semantic match with regex in snapshot', () => {
document.body.innerHTML = `
<p>Original</p>
<button aria-label="1234">Pattern</button>
`
expect(document.body).toMatchAriaInlineSnapshot(`
- paragraph: Original
- button "1234": Pattern
`)
})
test("empty", () => {
document.body.innerHTML = `
<button aria-hidden="true">Hidden</button>
`
expect(document.body).toMatchAriaInlineSnapshot()
})