mirror of
https://github.com/hanzoai/vitest.git
synced 2026-10-30 14:46:34 +00:00
31 lines
719 B
TypeScript
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()
|
|
})
|