added karma unit tests