Minor change to cancelEdit().

Added unit tests for cancelEdit().