How to get coverage over 80%

Hi Folks,

We are building a marketplace app, we are in the final stage of publishing the app to the marketplace. But we are unable to get coverage over 80%. We found few files where we are unable to get past 30%.

The files are separate modals, each modal consists of 2-3 flow, so all of the code won’t be executed on one flow. So we tried all the flows separately in all the modals, but every time we execute one flow, the previous flows coverage is getting lost.

So what we think is, whenever the modal is getting opened it is coming to the call stack and destroyed on modal close. So the coverage is being reset whenever the modal is opened.

In this case, how do we achieve 80% of coverage?


1 Like

Hi @arshath.h,

Could you show us the coverage report and the test coverage for those mentioned modals?
Also, the code snippet for those modals which cannot be covered without being reset will be able to help us understand the issue better.

[Please hide/remove any sensitive information for the account and business logic]

Hi @Raviraj,

I have shared the file in DM. Please let me know if you need further details.