diff --git a/src/alerts/active-enteprise-alert/ActiveEnterpriseAlert.test.jsx b/src/alerts/active-enteprise-alert/ActiveEnterpriseAlert.test.jsx index b631133b04..140d261cda 100644 --- a/src/alerts/active-enteprise-alert/ActiveEnterpriseAlert.test.jsx +++ b/src/alerts/active-enteprise-alert/ActiveEnterpriseAlert.test.jsx @@ -19,7 +19,7 @@ describe('ActiveEnterpriseAlert', () => { it('Shows alert message and links', () => { render(); expect(screen.getByRole('alert')).toBeInTheDocument(); - expect(screen.getByText('test message')).toBeInTheDocument(); + expect(screen.getByRole('alert').textContent).toBe(`${mockData.payload.text} change enterprise now.`); expect(screen.getByRole('link', { name: 'change enterprise now' })).toHaveAttribute( 'href', `${getConfig().LMS_BASE_URL}/enterprise/select/active/?success_url=http%3A%2F%2Flocalhost%2Fcourse%2Ftest-course-id%2Fhome`, ); diff --git a/src/courseware/CoursewareRedirectLandingPage.test.jsx b/src/courseware/CoursewareRedirectLandingPage.test.jsx index d9c1ce4189..08409380ea 100644 --- a/src/courseware/CoursewareRedirectLandingPage.test.jsx +++ b/src/courseware/CoursewareRedirectLandingPage.test.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import { render } from '@testing-library/react'; import { Router } from 'react-router'; import { createMemoryHistory } from 'history'; +import { render, initializeMockApp } from '../setupTest'; import CoursewareRedirectLandingPage from './CoursewareRedirectLandingPage'; const redirectUrl = jest.fn(); @@ -17,6 +17,7 @@ jest.mock('react-router', () => ({ describe('CoursewareRedirectLandingPage', () => { beforeEach(async () => { + await initializeMockApp(); delete global.location; global.location = { assign: redirectUrl }; });