describe('Directive acl', () => { let $scope; let $element; let element; let compile; beforeEach(ngModule('vnCore')); beforeEach(inject(($httpBackend, aclService) => { $httpBackend.whenGET('Accounts/acl') .respond({ user: {id: 1, name: 'myUser'}, roles: [ {role: {name: 'myRole'}}, {role: {name: 'myOtherRole'}} ] }); $httpBackend.whenPOST('Accounts/user/acl').respond([ { id: 1, model: 'ModelExample', property: '*', accessType: '*', permission: 'ALLOW', principalType: 'ROLE', principalId: 'employee' } ]); aclService.load(); $httpBackend.flush(); })); afterEach(() => { $element.remove(); $scope.$destroy(); }); compile = html => { inject(($compile, $rootScope) => { $scope = $rootScope.$new(); $element = $compile(html)($scope); $scope.$digest(); element = $element[0]; }); }; it('should not disable the input element as the user owns the role', () => { let html = `