Undefined is not a constructor (evaluating 'Permissionsservice.isPermitted(Entity,crud_check)') thrown

Asked

Viewed 43 times

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?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.