test( 'Returns "biennial subscription" for biennial plan', () => { const instance = new CartItem( props ); isMonthly.mockImplementation( () => false ); isYearly.mockImplementation( () => false ); isBiennially.mockImplementation( () => true ); expect( instance.getSubscriptionLength() ).toEqual( 'biennial subscription' ); } );
test( 'Returns false for unknown type of plan', () => { const instance = new CartItem( props ); isMonthly.mockImplementation( () => false ); isYearly.mockImplementation( () => false ); isBiennially.mockImplementation( () => false ); expect( instance.getSubscriptionLength() ).toEqual( false ); } );
test( 'Returns false values for cart item with invalid bill_period (4)', () => { const instance = new CartItem( { ...props, cartItem: { bill_period: -1 } } ); isMonthly.mockImplementation( () => true ); isYearly.mockImplementation( () => false ); isBiennially.mockImplementation( () => false ); expect( instance.getSubscriptionLength() ).toEqual( false ); } );