I wrote a OpportunityLineItem trigger that works with the OpportunityLineItemSchedule items related to it. Now I want to write unit tests for this trigger, and want to use sfdx to push the code to a scratch org to test things.
However, sfdx force:source:push
fails on this (simplified) code:
@isTest
private class OpportunityLineItemTest {
@isTest static void test() {
OpportunityLineItemSchedule schedule = new OpportunityLineItemSchedule();
}
}
with the error:
Invalid type: OpportunityLineItemSchedule
How do I create a unit test for OpportunityLineItem objects that use OpportunityLineItemSchedule objects? Do I need to enable a certain feature in the project-scratch-def.json
to be able to use these objects?