• Erik Yeary
  • NEWBIE
  • 30 Points
  • Member since 2021

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I wrote a test class for my class related to a lightning component, but when I run it I get 0 coverage.

Here is the class that needs to be tested:
public class User_List {
@AuraEnabled
   public static list <User_List__c> fetchList(){
      
      List <User_List__c> returnUserList = new List < User_List__c > ();
        
      for(User_List__c ul: [SELECT 	id, First_Name__c, Last_Name__c, Email__c, Extension_Number__c, Type_of_User_License__c, Phone_Model__c, Language__c, Outbound_Number_Display__c, Outbound_Name_Display__c, Voicemail_Option__c, CFNR_Number__c From User_List__c LIMIT 1000]) {
             returnUserList.add(ul);
          }
         return returnUserList;
   }
}

My test class basically has me creating a record of the objects needed before a User_List record is created and then it creates a User_List record.

This is my first time working with Lightning Components and alot of my test classes do the same thing so I'm wondering if I need to do something different here?

Help would be greatly appreciated!
Is there a limit to the number of daily Metadata API calls? I know about the normal API calls and the size limits on Metadata API, but I'm not seeing clear documentation on this question.

I'm aware custom metadata calls within Salesforce don't count against the SOQL query limits in a transaction; is this something similar? Do Metadata calls count against the API limit or no?
I'm doing an API Callout to an external REST endpoint from Apex. The endpoint is configured for GET and my code reflects that. For some reason, I am getting a "404: Not Found: Cannot POST /cancelAppointment". I'm confused because my request is clearly designated as a GET.

The site is correctly added to my remote site settings. Also - if I run the same request from Insomnia/Postman, it works fine. 

My code:

Http http = new Http();
  
HttpRequest request = new HttpRequest();
request.setEndpoint('https://ourwebsite.com/cancelAppointment');
request.setTimeout(20000);
request.setMethod('GET');
request.setHeader('Content-Type', 'text');
request.setHeader('Authorization', 'JWT ' + token); //token is a JWT 
request.setBody(getJSONBody()); //this is confirmed to work correctly
        
HttpResponse response = http.send(request);
if (response.getStatusCode() == 200) 
{
        System.debug(response.getBody());
}
else
{
System.debug(response.getStatusCode() + ': '  + response.getStatus();
System.debug(response.getBody());
}
I have a full page lightning web component that we host on a community page and we share that page publicly. I've noticed that sometimes when I make changes to the LWC that I don't see the changes reflected on the community page unless I open the page in an incognito browser. This makes me think that my browser (chrome) is caching the page.

Because this page has already been shared publicly, some of our users are probably not getting my updates for the same reason. Is there a simple way to disable caching on this page?

(the disable persistent browser caching setting has no effect on this) 
Is there a limit to the number of daily Metadata API calls? I know about the normal API calls and the size limits on Metadata API, but I'm not seeing clear documentation on this question.

I'm aware custom metadata calls within Salesforce don't count against the SOQL query limits in a transaction; is this something similar? Do Metadata calls count against the API limit or no?
I have a full page lightning web component that we host on a community page and we share that page publicly. I've noticed that sometimes when I make changes to the LWC that I don't see the changes reflected on the community page unless I open the page in an incognito browser. This makes me think that my browser (chrome) is caching the page.

Because this page has already been shared publicly, some of our users are probably not getting my updates for the same reason. Is there a simple way to disable caching on this page?

(the disable persistent browser caching setting has no effect on this) 
I wrote a test class for my class related to a lightning component, but when I run it I get 0 coverage.

Here is the class that needs to be tested:
public class User_List {
@AuraEnabled
   public static list <User_List__c> fetchList(){
      
      List <User_List__c> returnUserList = new List < User_List__c > ();
        
      for(User_List__c ul: [SELECT 	id, First_Name__c, Last_Name__c, Email__c, Extension_Number__c, Type_of_User_License__c, Phone_Model__c, Language__c, Outbound_Number_Display__c, Outbound_Name_Display__c, Voicemail_Option__c, CFNR_Number__c From User_List__c LIMIT 1000]) {
             returnUserList.add(ul);
          }
         return returnUserList;
   }
}

My test class basically has me creating a record of the objects needed before a User_List record is created and then it creates a User_List record.

This is my first time working with Lightning Components and alot of my test classes do the same thing so I'm wondering if I need to do something different here?

Help would be greatly appreciated!