Wrote Karma/Jasmine unit tests