I have the following code:
var li = renderedComponent.Find("li.validation-message");
Assert.Null(li);
The Find() call is throwing an exception instead of returning null. And HasComponent<>() needs a type. It's not clear what type to put in that.
There is a FindAll function. That throws no exception if there are no elements, so there is a possibility to check for 0 items
var validationMessages = renderedComponent.FindAll("li.validation-message");
Assert.That(validationMessages, Is.Empty);
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With