Trying to teach myself Salesforce Development.
I created a Lightning Component for a Communities page to create a Lead. The component works fine, simply calls the Apex class to insert the Lead.
However, I can't figure out how to write the test class required before this can be passed to production.
Here is the Apex Class to create the Lead:
public class LightningLeadCreatecls {
@AuraEnabled
public static void createLead(Lead leadObj){
insert leadObj;
}
}
I have written Apex Test Classes for Apex Classes that simply pull data with SELECT, but can't figure out how to create this test class. It is at 0/2.
Thanks.