File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/BootstrapBlazor/Components/Filters Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 55@if (IsHeaderRow )
66{
77 <div class =" @FilterRowClassString" >
8- <MultiSelect class =" is-filter" @bind-Value =" _value1" OnValueChanged =" _ => OnFilterAsync()"
8+ <MultiSelect class =" is-filter" Items = " @Items " @bind-Value =" _value1" OnValueChanged =" _ => OnFilterAsync()"
99 ShowLabel =" false" SkipValidate =" true" IsPopover =" true" ></MultiSelect >
1010 <FilterButton Items =" Items" @bind-Value =" _action1" OnSelectedItemChanged =" _ => OnFilterAsync()" OnClearFilter =" OnClearFilter" ></FilterButton >
1111 </div >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace UnitTest.Components;
88public class TableMultiSelectFilterTest : BootstrapBlazorTestBase
99{
1010 [ Fact ]
11- public void IsHeaderRow_Ok ( )
11+ public async Task IsHeaderRow_Ok ( )
1212 {
1313 var cut = Context . RenderComponent < TableColumnFilter > ( pb =>
1414 {
@@ -17,6 +17,22 @@ public void IsHeaderRow_Ok()
1717 pb . Add ( a => a . IsHeaderRow , true ) ;
1818 } ) ;
1919 cut . Contains ( "filter-row" ) ;
20+
21+ var actions = cut . FindAll ( ".dropdown-item" ) ;
22+ await cut . InvokeAsync ( ( ) => actions [ 1 ] . Click ( ) ) ;
23+
24+ // check filter
25+ var filter = cut . Instance ;
26+ var conditions = filter . FilterAction . GetFilterConditions ( ) ;
27+ Assert . Single ( conditions . Filters ) ;
28+
29+ // trigger onclear
30+ var clear = cut . Find ( ".btn-ban" ) ;
31+ await cut . InvokeAsync ( ( ) => clear . Click ( ) ) ;
32+
33+ // check filter
34+ conditions = filter . FilterAction . GetFilterConditions ( ) ;
35+ Assert . Empty ( conditions . Filters ) ;
2036 }
2137 [ Fact ]
2238 public async Task OnFilterAsync_Ok ( )
You can’t perform that action at this time.
0 commit comments