import allGlassPartsAndItemsHavePrices from './service-package-helper';

it('service package helper should return false when line item has missing price', () => {
    // Arrange
    const mockData = { glassParts: [{ partNumber: 'DW01571GBNNOEE', sellingPrice: 25 }], supportingItems: [{ laborAmount: 0 }] };
    // Act
    const actual = allGlassPartsAndItemsHavePrices(mockData);
    // Assert
    expect(actual).toEqual(false);
});

it('service package helper should return true when line item has all prices', () => {
    // Arrange
    const mockData = { glassParts: [{ partNumber: 'DW01571GBNNOEE', sellingPrice: 25 }], laborAmount: [{ sellingPrice: 10 }] };
    // Act
    const actual = allGlassPartsAndItemsHavePrices(mockData);
    // Assert
    expect(actual).toBeTruthy();
});
