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
test('requires a function as the first parameter',()=>{
48
+
test('requires an element to exist first',()=>{
49
49
returnexpect(
50
-
waitForElementToBeRemoved(),
50
+
waitForElementToBeRemoved(null),
51
51
).rejects.toThrowErrorMatchingInlineSnapshot(
52
-
`"waitForElementToBeRemoved requires a callback as the first parameter"`,
52
+
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
53
53
)
54
54
})
55
55
56
-
test('requires an element to exist first',()=>{
56
+
test('requires an unempty array of elements to exist first',()=>{
57
+
returnexpect(
58
+
waitForElementToBeRemoved([]),
59
+
).rejects.toThrowErrorMatchingInlineSnapshot(
60
+
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
61
+
)
62
+
})
63
+
64
+
test('requires an element to exist first (function form)',()=>{
57
65
returnexpect(
58
66
waitForElementToBeRemoved(()=>null),
59
67
).rejects.toThrowErrorMatchingInlineSnapshot(
60
68
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
61
69
)
62
70
})
63
71
64
-
test('requires an unempty array of elements to exist first',()=>{
72
+
test('requires an unempty array of elements to exist first (function form)',()=>{
'waitForElementToBeRemoved requires a callback as the first parameter',
10
-
),
11
-
)
12
-
}
13
-
14
-
// Check if the element is not present synchronously,
15
-
// As the name implies, waitForElementToBeRemoved should check `present` --> `removed`
16
-
if(isRemoved(callback())){
5
+
// Check if the element is not present.
6
+
// As the name implies, waitForElementToBeRemoved should check `present` --> `removed`
7
+
functioninitialCheck(elements){
8
+
if(isRemoved(elements)){
17
9
thrownewError(
18
10
'The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.',
0 commit comments