File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,23 @@ public async Task Items_SetActive()
150150 await cut . InvokeAsync ( ( ) => cut . Instance . SetActiveItem ( activeItem ) ) ;
151151 }
152152
153+ [ Fact ]
154+ public void AppendNode_Ok ( )
155+ {
156+ var items = TreeFoo . GetAccordionItems ( ) ;
157+ var cut = Context . RenderComponent < TreeView < TreeFoo > > ( pb =>
158+ {
159+ pb . Add ( a => a . Items , items ) ;
160+ } ) ;
161+ var contents = cut . FindAll ( ".tree-content" ) ;
162+ Assert . Equal ( 2 , contents . Count ) ;
163+
164+ items . Add ( new TreeViewItem < TreeFoo > ( new TreeFoo ( ) ) { Text = "append-text" } ) ;
165+ cut . SetParametersAndRender ( ) ;
166+ contents = cut . FindAll ( ".tree-content" ) ;
167+ Assert . Equal ( 3 , contents . Count ) ;
168+ }
169+
153170 [ Fact ]
154171 public async Task OnClick_Checkbox_Ok ( )
155172 {
You can’t perform that action at this time.
0 commit comments