File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ public void Type_Ok()
2020 Assert . Equal ( typeof ( EnumEducation ) , filter . Instance . Type ) ;
2121 }
2222
23+ [ Fact ]
24+ public async Task OnFilterAsync_Ok ( )
25+ {
26+ var cut = Context . RenderComponent < TableColumnFilter > ( pb =>
27+ {
28+ pb . Add ( a => a . Table , new MockTable ( ) ) ;
29+ pb . Add ( a => a . Column , new MockColumn ( ) ) ;
30+ pb . Add ( a => a . IsHeaderRow , true ) ;
31+ } ) ;
32+
33+ var items = cut . FindAll ( ".dropdown-item" ) ;
34+ await cut . InvokeAsync ( ( ) => { items [ 1 ] . Click ( ) ; } ) ;
35+ }
36+
2337 [ Fact ]
2438 public async Task FilterAction_Ok ( )
2539 {
@@ -76,6 +90,17 @@ public async Task FilterAction_Ok()
7690 Assert . Empty ( conditions . Filters ) ;
7791 }
7892
93+ class MockTable : ITable
94+ {
95+ public Dictionary < string , IFilterAction > Filters { get ; set ; } = [ ] ;
96+
97+ public Func < Task > ? OnFilterAsync { get ; set ; }
98+
99+ public List < ITableColumn > Columns => [ ] ;
100+
101+ public IEnumerable < ITableColumn > GetVisibleColumns ( ) => Columns ;
102+ }
103+
79104 class MockColumn : TableColumn < Foo , EnumEducation >
80105 {
81106 public MockColumn ( )
You can’t perform that action at this time.
0 commit comments