1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@isTest
private class SearchContactLWCControllerTest {
    static testMethod void testMethod1() {
        Oly_TriggerHandler.bypass('ContactTriggerHandler');
        TestDataUtility.CreatePIPolicyConfiguration('Contact');
        Contact con = TestDataUtility.CreateContacts(1)[0];
        con.AWS_Data_Id__c = 'davdsvgrqcx';
        con.RecordTypeId = [select id,DeveloperName,SobjectType from recordtype  where DeveloperName = 'Agency' and SobjectType = 'Contact' limit 1].id;
        update con;
        List<String> awsList = new List<String>();
        awsList.add(con.AWS_Data_Id__c);
        String awsListJson = JSON.serialize(awsList);
        Oly_TriggerHandler.bypass('UserToContact');
        String url = ApexPages.currentPage().getParameters().put('accountId',con.AccountId);
        url = ApexPages.currentPage().getParameters().put('ObjectType','Account');
        url = ApexPages.currentPage().getParameters().put('QueryFieldApiName','Account');
        url = ApexPages.currentPage().getParameters().put('inputHiddenId',con.AccountId);
        url = ApexPages.currentPage().getParameters().put('inputFieldId','ids');
        url = ApexPages.currentPage().getParameters().put('SelectObj','User');
        Test.startTest();
        SearchContactLWCController scc = new SearchContactLWCController();
        SearchContactLWCController.searchContactsNoPI(con.Name);
        SearchContactLWCController.searchContacts('String awsContactIds','','Name','String ObjectType','Name','Account','Name','','Name!=null');
        SearchContactLWCController.searchContacts('String awsContactIds','','Name','String ObjecType','Nme','Accout','Nae','','');
        SearchContactLWCController.searchContacts('String awsContactIds','N','Name','String ObjecType','Nme','Accout','Nae','','');
        PageReference pageT = new PageReference('/apex/SearchContactPageLWC?ObjectType=' + 'Account' + '&accountId=' + con.AccountId+ '&QueryFieldApiName=' + 'Account'+ '&SelectObj=' + 'Account');
        System.Test.setCurrentPage(pageT);
        NewQuoteIraiController controllerT = new NewQuoteIraiController();
        controllerT.init();
        Test.stopTest();
    }
}