refactor test for selectedNode