DAR-1184, add tests to karma
DAR-1184, change function description and error copy
DAR-1184, fix unit tests