File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace UnitTest.Components;
8
8
public class IFrameTest : BootstrapBlazorTestBase
9
9
{
10
10
[ Fact ]
11
- public void Frame_Ok ( )
11
+ public async Task Frame_Ok ( )
12
12
{
13
13
var postData = false ;
14
14
var cut = Context . RenderComponent < IFrame > ( pb =>
@@ -27,10 +27,26 @@ public void Frame_Ok()
27
27
pb . Add ( a => a . Data , new { Rows = new List < string > ( ) { "1" , "2" } } ) ;
28
28
} ) ;
29
29
30
- cut . InvokeAsync ( async ( ) =>
30
+ await cut . InvokeAsync ( async ( ) =>
31
31
{
32
- await cut . Instance . CallbackAsync ( new List < string > { "2" , "3" } ) ;
32
+ await cut . Instance . TriggerPostData ( new List < string > { "2" , "3" } ) ;
33
33
Assert . True ( postData ) ;
34
34
} ) ;
35
+
36
+ var loaded = false ;
37
+ cut . SetParametersAndRender ( pb =>
38
+ {
39
+ pb . Add ( a => a . OnReadyAsync , ( ) =>
40
+ {
41
+ loaded = true ;
42
+ return Task . CompletedTask ;
43
+ } ) ;
44
+ } ) ;
45
+
46
+ await cut . InvokeAsync ( async ( ) =>
47
+ {
48
+ await cut . Instance . TriggerLoaded ( ) ;
49
+ } ) ;
50
+ Assert . True ( loaded ) ;
35
51
}
36
52
}
You can’t perform that action at this time.
0 commit comments