describe('Directive acl', () => { let $scope; let $element; let element; let compile; beforeEach(angular.mock.module('vnCore', $translateProvider => { $translateProvider.translations('en', {}); })); beforeEach(inject(($httpBackend, aclService) => { $httpBackend.whenGET('/api/Accounts/acl') .respond({ user: {id: 1, name: 'myUser'}, roles: [ {role: {name: 'myRole'}}, {role: {name: 'myOtherRole'}} ] }); 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 = `