import { LoginPage } from '@admin-lib/index';
import { GuestTravelInfo, UserModal } from '@profile-lib/index';
import { createGuestDetails } from '@user-lib/index';
import { Provider_Type, User_Type } from '@support-onboard/index';
import { Profile } from '../../../lib/profile';

describe('Personal Travel: Guest Profile Page', () => {
  beforeEach(() => {
    GuestTravelInfo.interceptApis();
    UserModal.interceptApis();
    LoginPage.createNewCompanyAndLoginWithUserByType({
      providers: [Provider_Type.EXPEDIA_FLIGHT, Provider_Type.ALL_CAR],
      users: [User_Type.TRAVELER],
      companySuffix: 'rewardspt'
    });
    GuestTravelInfo.visitPage();
    GuestTravelInfo.waitToBeLoaded();
  });

  it('C11082431: Create a personal guest profile', { tags: ['@tier1'] }, () => {
    const guestDetails = createGuestDetails(30, 'MALE', 'Personal');
    Profile.openNewGuestModal();
    Profile.createPersonalUser(guestDetails);
    Profile.editPersonalGuest(guestDetails);
    Profile.deletePersonalGuest(guestDetails);
  });

  it('C11082432: Create a business guest profile', { tags: ['@tier2'] }, () => {
    const guestDetails = createGuestDetails(30, 'MALE', 'Business');
    Profile.switchGuestTravelerTab(' Business guest travelers ');
    Profile.openNewGuestModal();
    Profile.createBusinessUser(guestDetails);
  });
});
