2
Function:
function checkPermissions(entity, crud_check, msg, title, state_redirect, paramsRedirect) {
try {
if (PermissionsService.isPermitted(entity, crud_check) === false) {
showToastrError(title, msg, state_redirect, paramsRedirect);
}
} catch (e) {
throw e.message;
}
}
By performing the following test:
it('function checkPermissions', function(){
spyOn(srv, 'checkPermissions').and.callThrough();
expect(srv.checkPermissions).toBeDefined();
srv.checkPermissions(false, false, 'acabou erro', 'please', 'master', null);
});
I’m getting the bug:
Undefined is not a constructor (evaluating 'Permissionsservice.isPermitted(Entity,crud_check)') thrown
Can someone help me solve?