File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,27 @@ public async Task IgnoreCase_Ok()
196196 Assert . Equal ( 2 , menus . Count ) ;
197197 }
198198
199+ [ Fact ]
200+ public async Task TriggerClear_Ok ( )
201+ {
202+ var val = "task1" ;
203+ var items = new List < string > ( ) { "task1" , "Task2" } ;
204+ var cut = Context . RenderComponent < AutoComplete > ( builder =>
205+ {
206+ builder . Add ( a => a . Items , items ) ;
207+ builder . Add ( a => a . IgnoreCase , false ) ;
208+ builder . Add ( a => a . Value , val ) ;
209+ builder . Add ( a => a . IsClearable , true ) ;
210+ builder . Add ( a => a . ValueChanged , EventCallback . Factory . Create < string ? > ( this , v =>
211+ {
212+ val = v ;
213+ } ) ) ;
214+ } ) ;
215+
216+ await cut . InvokeAsync ( cut . Instance . TriggerClear ) ;
217+ Assert . Empty ( val ) ;
218+ }
219+
199220 [ Fact ]
200221 public async Task DisplayCount_Ok ( )
201222 {
You can’t perform that action at this time.
0 commit comments