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

describe('Train: Trenitalia roundtrip cancellation workflow', () => {
  it(
    'C473867: Should be able to book and cancel round train ticket',
    { tags: ['@trainitalia', '@all_train_test'] },
    () => {
      TrainSearchModalUtil.createCompanyWithProviderName({
        feeModelInfo: AgencyCurrency.Euro
      });
      TrainBookingManager.createFirstClassBooking({
        origin: TrenItaliaBookingParams.Location.Rome,
        destination: TrenItaliaBookingParams.Location.Milan,
        trainClass: true,
        fareType: TrenItaliaBookingParams.FareType.FIRST_CLASS,
        tripType: TrainTripType.ONEWAY
      });

      CancellationFlow.executeTrainCancellation(
        'We will send your e-ticket(s) to your email and Navan mobile app',
        TrainTripType.ROUND_TRIP
      );
    }
  );
});
