import { LoginPage } from '@admin-lib/index';
import { Provider_Type, User_Type } from '@support-onboard/index';
import { ProfileInterceptApis } from '@profile-lib/index';
import { TravelPlanner } from '../../lib/travel_planner';

describe('Personal Travel: EA Trips page', () => {
  beforeEach(() => {
    LoginPage.createNewCompanyAndLoginWithUserByType({
      providers: [Provider_Type.ALL_CAR],
      users: [User_Type.ADMIN],
      companySuffix: 'travelplanner'
    });
    ProfileInterceptApis.interceptProfileApis();
    TravelPlanner.assignDelegateAndViewTravelPlanner();
  });

  it(
    'C9756015: Verify delegate is able to view/edit traveler profile from EA trip page',
    { tags: ['@tier1'] },
    () => {
      TravelPlanner.acceptOnboardingAndBookmarkTraveler();
      cy.wait(3000);
      TravelPlanner.clickEditProfile();
      TravelPlanner.visitTravelerContactInfo();
      TravelPlanner.visitTravelerInfo();
      TravelPlanner.visitTravelerPaymentMethods();
      TravelPlanner.visitTravelerLoyaltyPrograms();
      TravelPlanner.visitTravelerNotifications();
      TravelPlanner.backToTravelPlanner();
    }
  );
});
