Refactor tests for User login