The following assertion should be supported:
assertComponents(
result.children,
<div>
{showHeader ? <h1>Welcome!</h1> : null}
<p>Hello</p>
</div>
);
Current behaviour: if showHeader is false assertion is failing in this false-positive case:
AssertionError: Children count doesn't match for div
actual: 1
expected: 2
Expected behaviour: assertion should pass in this case
Current workaround is filtering out null components on calling side:
assertComponents(
result.children,
showHeader ? (
<div>
<h1>Welcome!</h1>
<p>Hello</p>
</div>
) : (
<div>
<p>Hello</p>
</div>
)
);