add tests to verify selection is preserved