You need to sign in to do that
Don't have an account?

Apex test classes required when modifying force.com site?
Thinking this may be fundamental:
When a change is made to a .cmp, .js, or .css file by adding aura components, LWC, or adjusting the positioning of them, should an Apex test class be created for those changes as well?
If so, how to go about this? Is this the same as a controller?
Any links to resources to explain this?
Thank you.
Hi DML2020,
1)To determine the decrease in code coverage you have to rerun the test class again and note the overall percentage,
Here is official documentation: https://dreamevent.secure.force.com/articleView?id=sf.code_dev_console_tests_coverage.htm&type=5
2)Mainly test classes name are similar to controllerName but are not inside the controller
For example, In aura component
Here apex class name is LoginUserUi so its test class name can be LoginUserUI_Test/Test_LoginUserUi,
generally, we append _Test for test class naming(for best practice).
The same goes with Lwc
To search apex test class you can click:
File > Open and search by controller name, you will be able to find test class if it exists.
To determine the decrease in code coverage you have to rerun the test class again and note the overall percentage,
For test class documentation
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_test.htm
If you find this solution is helpful for you please mark best answer
All Answers
For lightning components, you will essentially be testing the controller and Jest Test for Lightning Web Components
See example here
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Thanks, Anudeep. Though I have a few more:
1. How to determine decrease in code coverage?
2. Where to find the test class to modify, if needed? Would this be contained in the controller file associated with the component?
Hi DML2020,
1)To determine the decrease in code coverage you have to rerun the test class again and note the overall percentage,
Here is official documentation: https://dreamevent.secure.force.com/articleView?id=sf.code_dev_console_tests_coverage.htm&type=5
2)Mainly test classes name are similar to controllerName but are not inside the controller
For example, In aura component
Here apex class name is LoginUserUi so its test class name can be LoginUserUI_Test/Test_LoginUserUi,
generally, we append _Test for test class naming(for best practice).
The same goes with Lwc
To search apex test class you can click:
File > Open and search by controller name, you will be able to find test class if it exists.
To determine the decrease in code coverage you have to rerun the test class again and note the overall percentage,
For test class documentation
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_test.htm
If you find this solution is helpful for you please mark best answer