import { LoginPage } from '@admin-lib/index';
import { HotelInterceptApis, Hotels } from '@hotel-lib/index';
import { Rewards } from '../lib/rewards';
import { stagingUsers } from '@fixtures/staging-users';

const newUserCredentials = Cypress.env('newUser').NEW_USER_PASSWORD;
describe('Rewards: CFR - Bookings', () => {
  beforeEach(() => {
    LoginPage.visitTALoginPage();
    LoginPage.loginWithCredentials(stagingUsers.cfr_user.email, newUserCredentials);
    HotelInterceptApis.interceptHotelApis();
  });

  it(
    'C7251423: Validate the rewards pill on homepage, global nav and rewards page at profile',
    { tags: ['@tier1'] },
    () => {
      Hotels.visitHotelSearch();
      Rewards.verifyRewardsOnGlobalNav();
      Rewards.verifyRewardsPillShown();
      Rewards.verifyRewardsRedirection();
    }
  );
});
