We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2ffd56 commit 65b6eecCopy full SHA for 65b6eec
packages/native/src/lib/ToBeEmptyElementAssertion.ts
@@ -42,10 +42,16 @@ export class ToBeEmptyElementAssertion extends Assertion<ReactTestInstance> {
42
}
43
44
private isEmpty(element: ReactTestInstance): boolean {
45
- if(!element?.props?.children) {
+ const children = element?.children;
46
+
47
+ if (!children) {
48
return true;
49
50
- return element?.props?.children.length === 0;
51
+ if (Array.isArray(children)) {
52
+ return children.length === 0;
53
+ }
54
55
+ return false;
56
-}
57
+}
0 commit comments