+ Start a Discussion
John Manager Training DepJohn Manager Training Dep 

Test partner or portal accounts having lightning components?

Hi Team,

I have an Apex code which used below SOQL,
ID cUID=  UserInfo.getUserId() ;

        User cU= [Select id, Name, ContactId from User where id = :cUID limit 1];

        Contact cC= [Select id, Name, AccountId, Account.name from Contact where id = :cU.ContactId limit 1];

        ID accountId = cC.AccountId;
The ContactId will have a value only for users who are enabled for Partner or Customer Portal accounts.

How do I create a Test Class and test it?
Also, it has lightning components, how do I test it?

Shyam SwamiShyam Swami
Put the bello Code on Line 1 In Your Test Class
John Manager Training DepJohn Manager Training Dep
But how do I design the test class for the above?