import { LoginPage } from '@admin-lib/login';

import {
  RentalCarInterceptApis,
  Trips,
  RentalCarDropOffType,
  RentalCarUtility,
  RentalCarLocationType,
  RentalCarParams,
  RentalCarOperators,
  LocationUtility,
  Provider_Type,
  User_Type
} from '@rentalCar-lib/index';

describe.skip('Rental car: Sabre Avis Direct Bill', () => {
  it(
    'C3810613: User should be able to book car using Direct bill and validate the booking data response',
    { tags: ['@tier1'] },
    () => {
      LoginPage.createNewCompanyAndLoginWithUserByType({
        providers: [Provider_Type.ALL_CAR],
        users: [User_Type.ADMIN]
      });
      cy.createDirectBillPaymentMethod(RentalCarOperators.AVIS, '7ZS17W');
      RentalCarInterceptApis.interceptRentalCarApis();
      const rentalCarParams: RentalCarParams = {
        tripTileType: 'Business',
        dropOffType: RentalCarDropOffType.sameDropOff,
        pickUpLocation: LocationUtility.getRentalCarAirportUS(),
        rentalCarLocationType: RentalCarLocationType.general,
        directBill: true,
        rentalCarOperator: 'Avis'
      };
      RentalCarUtility.bookingWorkflow(rentalCarParams);

      Trips.expectPaymentTypeIsDirectBill();
      cy.expectDirectBillBookingIsSuccessful('Avis Direct Bill');
    }
  );
});
