Add tests for insertBefore and insertAfter