Skip to content

Commit 60f0d08

Browse files
committed
test: ipdate toBeInTheDoc test
1 parent 8931bc2 commit 60f0d08

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/browser/fixtures/expect-dom/toBeInTheDocument.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ test('.toBeInTheDocument', () => {
4242
const expectToBe = /expect.*\.toBeInTheDocument/
4343
const expectNotToBe = /expect.*not\.toBeInTheDocument/
4444
const userInputNode = /an HTMLElement or an SVGElement/
45+
const notFound = /element could not be found in the document/
4546
expect(() => expect(htmlElement).not.toBeInTheDocument()).toThrowError(
4647
expectNotToBe,
4748
)
@@ -55,12 +56,10 @@ test('.toBeInTheDocument', () => {
5556
userInputNode,
5657
)
5758
expect(() => expect(nullElement).toBeInTheDocument()).toThrowError(
58-
userInputNode,
59+
notFound,
5960
)
6061
expect(() => expect(undefinedElement).toBeInTheDocument()).toThrowError(
61-
userInputNode,
62-
)
63-
expect(() => expect(undefinedElement).not.toBeInTheDocument()).toThrowError(
64-
userInputNode,
62+
notFound,
6563
)
64+
expect(() => expect(undefinedElement).not.toBeInTheDocument()).not.toThrowError()
6665
})

0 commit comments

Comments
 (0)