diff --git a/client/core/src/directives/specs/id.spec.js b/client/core/src/directives/specs/id.spec.js index 9fddae55f..33b6a3832 100644 --- a/client/core/src/directives/specs/id.spec.js +++ b/client/core/src/directives/specs/id.spec.js @@ -19,7 +19,7 @@ describe('Directive vnId', () => { it(`should throw an error when there's no id defined`, () => { let html = `
`; - expect(function errorExpected() { + expect(() => { compile(html); }).toThrow(new Error(`vnId: Attribute can't be null`)); }); @@ -27,8 +27,17 @@ describe('Directive vnId', () => { it(`should throw an error when these's no controller defined in $element[0]`, () => { let html = ``; - expect(function errorExpected() { + expect(() => { compile(html); }).toThrow(new Error(`vnId: Can't find controller for element '1'`)); }); + + it(`should set the controller into the $scope as there are no errors being thrown`, () => { + let html = ``; + + expect($scope['1']).not.toBeDefined(); + compile(html); + + expect($scope['1']).toBeDefined(); + }); });