Let's say I have a test like the one below. Is there a way to wait for an element to be present in the markup of a rendered component?
[Fact]
public void Component_DoesSomething()
{
// Arrange
var ctx = new TestContext();
var unitUnderTest = ctx.RenderComponent<SomeComponent>();
var selector = "tbody";
// Act
var tableBody = unitUnderTest.Find(selector);
// Assert
Assert.Contains(tableBody.InnerHtml, "someStuff");
}
I've reviewed the docs below, but I don't see anything indicating how to wait for an element.
You can use
IRenderedComponent.WaitForElement()
method. See the code below:See also:
WaitForElements()