fix(ViewLoader): provide componentId in missing template / templateUrl errors

Befor this change it wasn't clear which component is faulty
This commit is contained in:
Pawel Kozlowski
2015-08-21 14:40:13 +02:00
parent d853d19dd7
commit 3871f89119
2 changed files with 9 additions and 5 deletions
@@ -83,8 +83,10 @@ export function main() {
}));
it('should throw when no template is defined', () => {
expect(() => loader.load(new ViewDefinition({template: null, templateAbsUrl: null})))
.toThrowError('View should have either the templateUrl or template property set');
expect(() => loader.load(new ViewDefinition(
{componentId: 'TestComponent', template: null, templateAbsUrl: null})))
.toThrowError(
'View should have either the templateUrl or template property set but none was found for the \'TestComponent\' component');
});
it('should return a rejected Promise when XHR loading fails',