import { User_Type } from '@support-onboard/data_model/user_type';
import { HelpCenter } from '@helpcenter-lib/helpcenter';
import { ChatApiIntercept, ChatBooking, ChatBox, Banner } from '@chat-lib/index';
import { LocationUtility } from '@utility-lib/location';
import { LoginPage } from '@admin-lib/index';

describe('Chat: ML supported flows', () => {
  xit('C9568076: Use chat to book car via ML flow', { tags: ['@tier2'] }, () => {
    const daysToMove = { daysToMove: 8, daysAfterMovedDays: 2 };

    ChatApiIntercept.interceptChatApis();
    LoginPage.createNewCompanyAndLoginWithUserByType({
      users: [User_Type.ADMIN],
      companySuffix: '-avamltest'
    });
    HelpCenter.visitPage();
    ChatBox.openChatWithAva();
    ChatBox.typeMsgToAva(
      `I want to book a car in ${LocationUtility.getGeneralRentalCarLocation()}`
    );
    ChatBox.expectMsgReceivedFromAva(`provide`);
    ChatBooking.enterShiftedDates(daysToMove);
    ChatBox.readAvaMsgAndTypeReply('confirm', 'Yes');
    Banner.expectBannerContainsText('An agent will be with you shortly.');
  });
});
