From b1daf11714b8f110ace1fbbb8b369e8833bd4d58 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 24 Apr 2026 08:19:04 +0200 Subject: [PATCH] fix: note about missing elements should not show in verbose mode --- src/formatters/SnapshotFormatter.ts | 2 +- tests/formatters/snapshotFormatter.test.js.snapshot | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/formatters/SnapshotFormatter.ts b/src/formatters/SnapshotFormatter.ts index bc13f641b..29488cf52 100644 --- a/src/formatters/SnapshotFormatter.ts +++ b/src/formatters/SnapshotFormatter.ts @@ -20,7 +20,7 @@ export class SnapshotFormatter { // Top-level content of the snapshot. if ( - this.#snapshot.verbose && + !this.#snapshot.verbose && this.#snapshot.hasSelectedElement && !this.#snapshot.selectedElementUid ) { diff --git a/tests/formatters/snapshotFormatter.test.js.snapshot b/tests/formatters/snapshotFormatter.test.js.snapshot index bb2e1ccbf..ee7c3ae20 100644 --- a/tests/formatters/snapshotFormatter.test.js.snapshot +++ b/tests/formatters/snapshotFormatter.test.js.snapshot @@ -1,7 +1,4 @@ exports[`snapshotFormatter > does not include a note if the snapshot is already verbose 1`] = ` -Note: there is a selected element in the DevTools Elements panel but it is not included into the current a11y tree snapshot. -Get a verbose snapshot to include all elements if you are interested in the selected element. - uid=1_1 checkbox "checkbox" checked uid=1_2 statictext "text" @@ -14,6 +11,9 @@ uid=1_1 checkbox "checkbox" checked [selected in the DevTools Elements panel] `; exports[`snapshotFormatter > formats with DevTools data not included into a snapshot 1`] = ` +Note: there is a selected element in the DevTools Elements panel but it is not included into the current a11y tree snapshot. +Get a verbose snapshot to include all elements if you are interested in the selected element. + uid=1_1 checkbox "checkbox" checked uid=1_2 statictext "text"