MoveOperation#execute should be changed to not throw when you move i.e. two nodes from graveyard [ 0 ] to root [ 1, 1 ]. Right now, MoveOperation does not count that these are different roots and thinks that this is wrong operation (because you try to move node 1 into itself).
} else {
if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {
to
} else if ( this.sourcePosition.root == this.targetPosition.root ) {
if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {
Don't forget about tests ;)
I hate you.
Most helpful comment
I hate you.