Skip to content

Commit

Permalink
docs: demo test
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed May 12, 2024
1 parent 4bb18b0 commit b06b6e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@

For Storybook integration see [`storybook-addon-aria-live`](https://github.com/AriPerkkio/storybook-addon-aria-live).

```js
test('live region is announced', () => {
const region = document.createElement('div');
region.setAttribute('role', 'status');

document.body.appendChild(region);
region.textContent = 'Loading';

expect('Loading').toBeAnnounced('polite');
});
```

## Motivation

Read more about inspiration from [Building testing tools for ARIA live regions](https://loihdefactor.com/en/2022/04/29/building-testing-tools-for-aria-live-regions).
Expand Down

0 comments on commit b06b6e2

Please sign in to comment.