Date: Fri, 29 Mar 2024 06:16:08 +0000 (UTC) Message-ID: <1765230630.1.1711692968011@0fa67820096c> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_0_856830970.1711692967998" ------=_Part_0_856830970.1711692967998 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
To make sure your custom form logic in GoMeddo is unit tested a global c= lass called Test_FormHelper, is added to the applications.= This class contains helper methods that allow you to trigger form events.<= /p>
Because these methods fire an event as if it was fired from the form to = make the behaviour consistent during unit tests and normal operation the de= fault GoMeddo handlers are also fired. This means the return value of FormE= vent could include FormEvents produced by GoMeddo.
To let GoMeddo know that there is custom logic in place you need to add =
a @TestSetup
. Which creates the setting in the unit test.
@TestSe= tup static void makeData(){ B25__System_Setting__c systemSetting =3D new B25__System_Setting__c(); systemSetting.Name =3D'Reservation Form Customizer Class'; systemSetting.B25__String_Value__c =3D <CUSTOMIZER_APEX_CLASS_NAME&g= t;; Database.insert(systemSetting); }
Using this method, you can trigger a form initialization event = to test your custom form implementations.
List<= ;B25.FormEvent> runFormInitializationEvent(B25.Test_FormHelper.TestFormC= ontext formContext)
Return value: List<B25.FormEvent<= /a>>
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the initialization event. |
Using this method you can trigger a field change event to test = your custom form implementations.
List<= ;B25.FormEvent> runFieldChangeEvent(B25.Test_FormHelper.TestFormContext = formContext, B25.Test_FormHelper.TestChangeEvent changeEvent)
Return value: List<B25.FormEvent<= /a>>
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the field change event. |
changeEvent |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260410573= 3/B25.Test+FormHelper.TestChangeEvent |
The change event that is being fired |
Using this method you can trigger a related list item add event= to test your custom form implementations.
List<= ;B25.FormEvent> runRelatedListAddEvent(B25.Test_FormHelper.TestFormConte= xt formContext, B25.Test_FormHelper.TestRelatedListEvent changeEvent)
Return value: List<B25.FormEvent<= /a>>
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the related list add event. |
changeEvent |
The related list event that is being fired |
Using this method you can trigger a related list item remove event= em> to test your custom form implementations.
List<= ;B25.FormEvent> runRelatedListRemoveEvent(B25.Test_FormHelper.TestFormCo= ntext formContext, B25.Test_FormHelper.TestRelatedListEvent changeEvent)
Return value: List<B25.FormEvent<= /a>>
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the related list remove event. |
changeEvent |
The related list event that is being fired |
Using this method you can trigger a search event to test your c= ustom form implementations.
B25.Sea= rchResultCollection runLookupOverrideSearch(B25.Test_FormHelper.TestFormCon= text formContext, B25.Test_FormHelper.TestSearchContext testSearchContext)<= /pre>
Return value: B25.SearchResultCollection
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the search event. |
changeEvent |
The search context. |
Using this method, you can trigger a form before save event to = test your custom form implementations.
List<= ;B25.FormEvent> runBeforeSaveEvent(B25.Test_FormHelper.TestFormContext f= ormContext)
Return value: List<B25.FormEvent<= /a>>
Parameters:
Name |
Type |
Description |
---|---|---|
formContext |
https://gomeddo.atlassian.net/wiki/spaces/BPD/pages/260374528= 5/B25.Test+FormHelper.TestFormContext |
The context of the form during the save event. |