add unit test for close event, undo end event (#9)