Fixes expanding of Tree Item when its children are created dynamically
Adds test for it