Skip to content

Commit 67128de

Browse files
kschowfeedmypixel
authored andcommitted
docs: Update documentation for toBeVisible with details element examples
1 parent 2f8db0d commit 67128de

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ clear to read and to maintain.
4949
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
5050
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5151

52-
5352
- [Installation](#installation)
5453
- [Usage](#usage)
5554
- [With TypeScript](#with-typescript)
@@ -424,6 +423,14 @@ An element is visible if **all** the following conditions are met:
424423
</div>
425424
<div data-testid="visible">Visible Example</div>
426425
<div data-testid="hidden-attribute" hidden>Hidden Attribute Example</div>
426+
<details>
427+
<summary>Title of hidden text</summary>
428+
Hidden Details Example
429+
</details>
430+
<details open>
431+
<summary>Title of visible text</summary>
432+
<div>Visible Details Example</div>
433+
</details>
427434
```
428435

429436
```javascript
@@ -433,6 +440,8 @@ expect(getByText('Display None Example')).not.toBeVisible()
433440
expect(getByText('Hidden Parent Example')).not.toBeVisible()
434441
expect(getByText('Visible Example')).toBeVisible()
435442
expect(getByText('Hidden Attribute Example')).not.toBeVisible()
443+
expect(getByText('Hidden Details Example')).not.toBeVisible()
444+
expect(getByText('Visible Details Example')).toBeVisible()
436445
```
437446

438447
<hr />
@@ -1204,12 +1213,8 @@ To perform a partial match, you can pass a `RegExp` or use
12041213
#### Examples
12051214

12061215
```html
1207-
<button aria-label="Close" aria-describedby="description-close">
1208-
X
1209-
</button>
1210-
<div id="description-close">
1211-
Closing will discard any changes
1212-
</div>
1216+
<button aria-label="Close" aria-describedby="description-close">X</button>
1217+
<div id="description-close">Closing will discard any changes</div>
12131218

12141219
<button>Delete</button>
12151220
```

0 commit comments

Comments
 (0)