• Krizia Buck
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
For simplicity, one method in my class looks a little like this and it works in manual testing: 
@AuraEnabled
    public static String getCitySuggestions(String input) {
        String response;
        String url = GOOGLE_PLACE_AUTOCOMPLETE_ENDPOINT + 'input=' + EncodingUtil.urlEncode(input, 'UTF-8') + '&types=(cities)' + getKey();
        String key = input.replaceAll('[^a-zA-Z0-9]', '');
        //Input will sometimes include a '.' or space, cannot cache
        if ((key == input) && (key.length() <= 50)) {
            if (!Cache.Org.contains(key)) {
                response = getResponse(url);
                Cache.Org.put(key, response);
            } else {
                response = (String) Cache.Org.get(key);
            }
            if (!response.contains('"status" : "OK"')) {
                Cache.Org.remove(key);
            }
        } else {
            response = getResponse(url);
        }
        return response;
    }
In my test class, I run the same method twice so that I should hit the lines that populate the cache the first time then the lines that access the cache in the second. Only the lines that populate the cache run and if I have an assert to make sure the cache has the value, it fails. 

How do I test Platform Cache in a test class? 
 
Hi there,

I am trying to utilize the lightning-map Lightning Web Component for the standard Account object. It works beautifully when displaying the data on the map and in the built in list view. My issue though is that it does not open up the record when I click on either the map marker or the item in the list view, instead it just refreshes the page. Has anyone else seen this issue? 

My LWC is using Lightning Out in an Aura App within a Visualforce page. As I mentioned before, everything is properly displaying as expected, but all that is wrong is that the page refreshes upon clicking what look like hyperlinks to the Account records. 

Any help is much appreciated! Thank you! 
Hi there,

I am trying to utilize the lightning-map Lightning Web Component for the standard Account object. It works beautifully when displaying the data on the map and in the built in list view. My issue though is that it does not open up the record when I click on either the map marker or the item in the list view, instead it just refreshes the page. Has anyone else seen this issue? 

My LWC is using Lightning Out in an Aura App within a Visualforce page. As I mentioned before, everything is properly displaying as expected, but all that is wrong is that the page refreshes upon clicking what look like hyperlinks to the Account records. 

Any help is much appreciated! Thank you!