refactored Angular unit test