add test cases for leave