add unit tests for login and validation