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

describe('Train: Amtrak oneway cancellation workflow', () => {
  it(
    'C48360: Should be able to book and cancel one way train ticket',
    { tags: ['@amtrak', '@all_train_test'] },
    () => {
      TrainSearchModalUtil.createCompanyWithProviderName({});
      const tripType = TrainTripType.ONEWAY;
      TrainBookingManager.createFirstClassBooking({
        origin: AmtrakBookingParams.Location.NewYork,
        destination: AmtrakBookingParams.Location.Washington,
        tripType: tripType,
        trainClass: true,
        fareType: AmtrakBookingParams.FareType.FIRST_CLASS
      });
      cy.contains('We advise you to print your e-ticket(s) for this route.');

      CancellationFlow.executeTrainCancellation(
        'We advise you to print your e-ticket(s) for this route.',
        tripType
      );
    }
  );
});
