Skip to content

Commit 71d1351

Browse files
authored
test: add failing test for #104
1 parent 2bc084f commit 71d1351

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/__tests__/to-have-text-content.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ describe('.toHaveTextContent', () => {
2424
expect(queryByTestId('count-value')).not.toHaveTextContent('2'),
2525
).toThrowError()
2626
})
27+
28+
test('handles falsy values for text content', () => {
29+
const {queryByTestId} = render(`<span data-testid="count-value">0</span>`)
30+
31+
expect(() =>
32+
expect(queryByTestId('count-value2')).toHaveTextContent(''),
33+
).toThrowError()
34+
})
2735

2836
test('normalizes whitespace by default', () => {
2937
const {container} = render(`

0 commit comments

Comments
 (0)