@@ -3838,6 +3838,14 @@ public async Task CustomerSearchTemplate_Ok()
38383838 var resetButton = cut . Find ( ".fa-trash-can" ) ;
38393839 await cut . InvokeAsync ( ( ) => resetButton . Click ( ) ) ;
38403840 Assert . Null ( searchModel . Name ) ;
3841+
3842+ var table = cut . FindComponent < Table < Foo > > ( ) ;
3843+ table . SetParametersAndRender ( pb =>
3844+ {
3845+ pb . Add ( a => a . ShowAdvancedSearch , false ) ;
3846+ } ) ;
3847+ await cut . InvokeAsync ( ( ) => resetButton . Click ( ) ) ;
3848+ Assert . Null ( searchModel . Name ) ;
38413849 }
38423850
38433851 [ Fact ]
@@ -3849,7 +3857,6 @@ public void SearchTemplate_Ok()
38493857 pb . AddChildContent < Table < Foo > > ( pb =>
38503858 {
38513859 pb . Add ( a => a . ShowSearch , true ) ;
3852- pb . Add ( a => a . SearchModel , new Foo ( ) ) ;
38533860 pb . Add ( a => a . SearchMode , SearchMode . Top ) ;
38543861 pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
38553862 pb . Add ( a => a . SearchTemplate , foo => builder => builder . AddContent ( 0 , "test_SearchTemplate" ) ) ;
@@ -3863,8 +3870,17 @@ public void SearchTemplate_Ok()
38633870 } ) ;
38643871 } ) ;
38653872 } ) ;
3866-
38673873 cut . Contains ( "test_SearchTemplate" ) ;
3874+
3875+ var table = cut . FindComponent < Table < Foo > > ( ) ;
3876+ Assert . NotNull ( table . Instance . SearchModel ) ;
3877+
3878+ table . SetParametersAndRender ( pb =>
3879+ {
3880+ pb . Add ( a => a . SearchModel , null ) ;
3881+ pb . Add ( a => a . CreateSearchModelCallback , ( ) => new Foo ( ) ) ;
3882+ } ) ;
3883+ Assert . NotNull ( table . Instance . SearchModel ) ;
38683884 }
38693885
38703886 [ Fact ]
0 commit comments