function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
d1c3m4nd1c3m4n 

Testing Virtual Class for Component

Hi,

 

Wanted to get some inputs on the best way to provide test coverage for this setup:

 

What I've got are:

- 2 Components

- 1 Component Controller Class that is being referenced by the 2 components

- 2 Virtual Classes (1 to extend the Page Controller and 1 to extend the Component Controller)

- 1 Page where the components are all shown

- 1 Page Controller Class where the components' properties are utilised

 

Still in the process of trying out that creating a test class just for the Page Controller would be sufficient.

 

Any experience on something similar before? 

 

Thanks!

 

Navatar_DbSupNavatar_DbSup

Hi,


You have to write the test method for all the class which you are going to deploy. The overall coverage of your all classes (only those which you want to deploy) must be at list 75%, then only you will be able to deploy your code. So by writing the test method for only one class will not help you.

d1c3m4nd1c3m4n

Understand all that and I'm aware of the test coverage requirements.

 

What I'm not familiar with is how virtual classes are typically tested.

Thus my question around whether the Page Controller test class would be sufficient to cover both the Page Controller class itself and the virtual class that extends it.