File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,33 @@ public void EnumValue_Ok()
153153 Assert . Contains ( "multi-select" , cut . Markup ) ;
154154 }
155155
156+ [ Fact ]
157+ public async Task FlagEnum_Ok ( )
158+ {
159+ var value = MockFlagEnum . One | MockFlagEnum . Two ;
160+ var cut = Context . RenderComponent < MultiSelect < MockFlagEnum > > ( pb =>
161+ {
162+ pb . Add ( a => a . Value , value ) ;
163+ } ) ;
164+ var values = cut . FindAll ( ".multi-select-items .multi-select-item" ) ;
165+ Assert . Equal ( 2 , values . Count ) ;
166+
167+ // 选中第四个
168+ var item = cut . FindAll ( ".dropdown-menu .dropdown-item" ) . Last ( ) ;
169+ await cut . InvokeAsync ( ( ) => item . Click ( ) ) ;
170+ values = cut . FindAll ( ".multi-select-items .multi-select-item" ) ;
171+ Assert . Equal ( 3 , values . Count ) ;
172+ }
173+
174+ [ Flags ]
175+ private enum MockFlagEnum
176+ {
177+ One = 1 ,
178+ Two = 2 ,
179+ Three = 4 ,
180+ Four = 8
181+ }
182+
156183 [ Fact ]
157184 public void Group_Ok ( )
158185 {
You can’t perform that action at this time.
0 commit comments