You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/__tests__/wait-for-element-to-be-removed.js
+14
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,20 @@ test('requires an element to exist first', () => {
42
42
)
43
43
})
44
44
45
+
test("requires element's parent to exist first",()=>{
46
+
const{getByTestId}=renderIntoDocument(`
47
+
<div data-testid="div">asd</div>
48
+
`)
49
+
constdiv=getByTestId('div')
50
+
div.parentElement.removeChild(div)
51
+
52
+
returnexpect(
53
+
waitForElementToBeRemoved(div),
54
+
).rejects.toThrowErrorMatchingInlineSnapshot(
55
+
`"The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
56
+
)
57
+
})
58
+
45
59
test('requires an unempty array of elements to exist first',()=>{
0 commit comments