import {
  TrainSearchModalUtil,
  TrainTripType,
  TrainBookingManager,
  SncfBookingParams,
  TrainItinerary,
  AgencyCurrency
} from '@train-lib/index';

describe('Train: SNCF oneway Seat selection using SeatMap', () => {
  it(
    'C473860: Should be able to select a seat using a seat map and book a train ticket',
    { tags: ['@sncf', '@all_train_test', '@france'] },
    () => {
      const roundTrip = TrainTripType.ROUND_TRIP;
      TrainSearchModalUtil.createCompanyWithProviderName({
        feeModelInfo: AgencyCurrency.Euro
      });
      TrainBookingManager.createFirstClassBooking({
        origin: SncfBookingParams.Location.Paris,
        destination: SncfBookingParams.Location.Lyon,
        fareType: SncfBookingParams.FareType.FIRST_CLASS,
        tripType: roundTrip,
        SeatMap: true,
        trainClass: true
      });
      TrainItinerary.expectSeatMapDetailsArePresent(roundTrip);
      TrainItinerary.expectETicketIsDownloadable();
    }
  );
});
