-
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathMarkupMatchesTests.razor
More file actions
32 lines (26 loc) · 921 Bytes
/
MarkupMatchesTests.razor
File metadata and controls
32 lines (26 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@using Bunit.TestAssets.SampleComponents
@inherits TestContext
@code {
public MarkupMatchesTests()
{
DefaultWaitTimeout = TimeSpan.FromSeconds(30);
}
[Fact]
public void MarkupMatchesShouldNotBeBlockedByRenderer()
{
var tcs = new TaskCompletionSource<object?>();
var cut = Render(@<LoadingComponent Task="@tcs.Task" /> );
cut.MarkupMatches(@<span>loading</span> );
tcs.SetResult(true);
cut.WaitForAssertion(() => cut.MarkupMatches(@<span>done</span>));
}
[Fact]
public void MarkupMatchesShouldNotBeBlockedByRendererComplex()
{
var tcs = new TaskCompletionSource<object?>();
var cut = Render(@<InvokeAsyncInsideContinueWith Task="@tcs.Task" /> );
cut.MarkupMatches(@<span>waiting</span>);
tcs.SetResult(true);
cut.WaitForAssertion(() => cut.MarkupMatches(@<span>done</span>));
}
}