import { LoginPage } from '@admin-lib/index';
import { User_Type } from '@support-onboard/index';
import { HotelItinerary, HotelInterceptApis, bookHotel } from '@hotel-lib/index';
import { Itinerary } from '../../../lib';

describe('Personal Travel: Bleisure - Itinerary extend hotel from trips', () => {
  beforeEach(() => {
    LoginPage.createNewCompanyAndLoginWithUserByType({
      users: [User_Type.PERSONAL_TRAVELER]
    });
    HotelInterceptApis.interceptHotelApis();
  });

  it(
    'C4604827: Add personal night upsell banner shows for business hotel bookings',
    { tags: ['@tier2'] },
    () => {
      bookHotel('Business');
      HotelItinerary.visitItinerary();
      HotelItinerary.viewAndManageItinerary();
      Itinerary.verifyUpsellBanner();
    }
  );

  it(
    'C4604828: Add personal night upsell banner should not show for personal hotel bookings',
    { tags: ['@tier1'] },
    () => {
      bookHotel('Personal');
      HotelItinerary.visitItinerary();
      HotelItinerary.viewAndManageItinerary();
      Itinerary.expectNoUpsellBannerExist();
    }
  );

  it(
    'C4604829: Add personal night upsell banner should not show for canceled hotel bookings',
    { tags: ['@tier2'] },
    () => {
      bookHotel('Business');
      HotelItinerary.visitItinerary();
      HotelItinerary.viewAndManageItinerary();
      HotelItinerary.cancelHotel();
      Itinerary.expectNoUpsellBannerExist();
    }
  );
});
