Skip to content

Commit a6927f7

Browse files
Copilotsheremet-va
andcommitted
Add inline snapshots to tests with expected filtered output
Co-authored-by: sheremet-va <[email protected]>
1 parent 7c66451 commit a6927f7

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

test/browser/test/utils.test.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,15 @@ test('filterNode option filters out matching elements', async () => {
132132
expect(result).not.toContain('color: red')
133133
expect(result).not.toContain('hidden content')
134134
expect(result).toContain('visible content')
135-
expect(result).toMatchInlineSnapshot()
135+
expect(result).toMatchInlineSnapshot(`
136+
"<div>
137+
<div>
138+
<span>
139+
visible content
140+
</span>
141+
</div>
142+
</div>"
143+
`)
136144
})
137145

138146
test('filterNode with configurePrettyDOM affects default behavior', async () => {
@@ -155,7 +163,15 @@ test('filterNode with configurePrettyDOM affects default behavior', async () =>
155163
expect(result).not.toContain('color: red')
156164
expect(result).not.toContain('hidden content')
157165
expect(result).toContain('visible content')
158-
expect(result).toMatchInlineSnapshot()
166+
expect(result).toMatchInlineSnapshot(`
167+
"<div>
168+
<div>
169+
<span>
170+
visible content
171+
</span>
172+
</div>
173+
</div>"
174+
`)
159175
})
160176

161177
test('filterNode with wildcard selector filters nested content', async () => {
@@ -177,5 +193,16 @@ test('filterNode with wildcard selector filters nested content', async () => {
177193
expect(result).not.toContain('deeply nested hidden')
178194
expect(result).toContain('visible')
179195
expect(result).toContain('data-test-hide-content')
180-
expect(result).toMatchInlineSnapshot()
196+
expect(result).toMatchInlineSnapshot(`
197+
"<div>
198+
<div>
199+
<div
200+
data-test-hide-content=\"\"
201+
/>
202+
<span>
203+
visible
204+
</span>
205+
</div>
206+
</div>"
207+
`)
181208
})

0 commit comments

Comments
 (0)