You need to sign in to do that
Don't have an account?
Jonathan Wolff 7
test Class for Search Component Apex Class
Hello,
I need a test class for a component I made. Could you help me with it?
APEX CLASS
public class MediathekSearchController {
@AuraEnabled(cacheable=true)
public static List<List<sObject>> getSearchResult(String searchKey){
List<List<sObject>> searchResult = [FIND :searchKey
IN ALL FIELDS RETURNING
Mediathek__c (Id, Name)
];
return searchResult;
}
}
I need a test class for a component I made. Could you help me with it?
APEX CLASS
public class MediathekSearchController {
@AuraEnabled(cacheable=true)
public static List<List<sObject>> getSearchResult(String searchKey){
List<List<sObject>> searchResult = [FIND :searchKey
IN ALL FIELDS RETURNING
Mediathek__c (Id, Name)
];
return searchResult;
}
}
You can try below sample code
If it helps mark it as best answer.
Thanks!
All Answers
You can try below sample code
If it helps mark it as best answer.
Thanks!
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
Hi,
You can take references from the below code.
https://www.infallibletechie.com/2019/06/adding-sosl-queries-to-unit-tests.html
Please mark it as the Best Answer so that other people would take references from it.
Thank You