add test cases for undo