You can have as many test statements as you want. But for many, it is difficult to read when these tests fail. The reason is that you need to scan dozens of lines to find out what is wrong, instead of just seeing that 'should be not reviewed if not admin, language is set and mapper is newer' does not work.
Btw. in your case, you could write a helper function so that you don't have such a large template:
var admin = true; var notAdmin = false init(isAdmin, language, year) { scope.globals.isAdmin = isAdmin; scope.globals.language = language; mapper.updatedOn.setYear(year); } it('should be not reviewed if not admin, language is set and mapper is newer', inject(function() { init(admin, 'de', 2015) expect(scope.isReviewed(mapper)).toBe(false); }));
source share