Пример #1
0
		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' );
		} );
Пример #2
0
		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 );
		} );
Пример #3
0
		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 );
		} );