Skip to content

Commit 80bee1e

Browse files
authored
fix: note about missing elements should not show in verbose mode (#1950)
Closes #1947
1 parent 136da6a commit 80bee1e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/formatters/SnapshotFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class SnapshotFormatter {
2020

2121
// Top-level content of the snapshot.
2222
if (
23-
this.#snapshot.verbose &&
23+
!this.#snapshot.verbose &&
2424
this.#snapshot.hasSelectedElement &&
2525
!this.#snapshot.selectedElementUid
2626
) {

tests/formatters/snapshotFormatter.test.js.snapshot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
exports[`snapshotFormatter > does not include a note if the snapshot is already verbose 1`] = `
2-
Note: there is a selected element in the DevTools Elements panel but it is not included into the current a11y tree snapshot.
3-
Get a verbose snapshot to include all elements if you are interested in the selected element.
4-
52
uid=1_1 checkbox "checkbox" checked
63
uid=1_2 statictext "text"
74

@@ -14,6 +11,9 @@ uid=1_1 checkbox "checkbox" checked [selected in the DevTools Elements panel]
1411
`;
1512

1613
exports[`snapshotFormatter > formats with DevTools data not included into a snapshot 1`] = `
14+
Note: there is a selected element in the DevTools Elements panel but it is not included into the current a11y tree snapshot.
15+
Get a verbose snapshot to include all elements if you are interested in the selected element.
16+
1717
uid=1_1 checkbox "checkbox" checked
1818
uid=1_2 statictext "text"
1919

0 commit comments

Comments
 (0)