add unit tests to test ui flow