Skip to content

Commit

Permalink
test: fix CoursewereContainer test
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoa committed Apr 12, 2024
1 parent 374f472 commit 0863345
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/courseware/CoursewareContainer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import MockAdapter from 'axios-mock-adapter';

import { UserMessagesProvider } from '../generic/user-messages';
import tabMessages from '../tab-page/messages';
import { initializeMockApp, waitFor } from '../setupTest';
import { initializeMockApp } from '../setupTest';
import { DECODE_ROUTES } from '../constants';

import CoursewareContainer from './CoursewareContainer';
Expand Down Expand Up @@ -212,7 +212,7 @@ describe('CoursewareContainer', () => {
});

history.push(`/course/${courseId}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

assertLoadedHeader(container);
assertSequenceNavigation(container);
Expand All @@ -235,7 +235,7 @@ describe('CoursewareContainer', () => {
axiosMock.onGet(`${getConfig().LMS_BASE_URL}/api/courseware/resume/${courseId}`).reply(200, {});

history.push(`/course/${courseId}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

assertLoadedHeader(container);
assertSequenceNavigation(container);
Expand Down Expand Up @@ -285,7 +285,7 @@ describe('CoursewareContainer', () => {
describe('when the URL does not contain a unit ID', () => {
it('should choose a unit within the section\'s first sequence', async () => {
setUrl(sectionTree[1].id);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();
assertLoadedHeader(container);
assertSequenceNavigation(container, 2);
assertLocation(container, sequenceTree[1][0].id, unitTree[1][0][0].id);
Expand Down Expand Up @@ -360,7 +360,7 @@ describe('CoursewareContainer', () => {

it('should pick the first unit if position was not defined (activeUnitIndex becomes 0)', async () => {
history.push(`/course/${courseId}/${sequenceBlock.id}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

assertLoadedHeader(container);
assertSequenceNavigation(container);
Expand All @@ -379,7 +379,7 @@ describe('CoursewareContainer', () => {
setUpMockRequests({ sequenceMetadatas: [sequenceMetadata] });

history.push(`/course/${courseId}/${sequenceBlock.id}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

assertLoadedHeader(container);
assertSequenceNavigation(container);
Expand All @@ -396,7 +396,7 @@ describe('CoursewareContainer', () => {

it('should load the specified unit', async () => {
history.push(`/course/${courseId}/${sequenceBlock.id}/${unitBlocks[2].id}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

assertLoadedHeader(container);
assertSequenceNavigation(container);
Expand All @@ -412,7 +412,7 @@ describe('CoursewareContainer', () => {
});

history.push(`/course/${courseId}/${sequenceBlock.id}/${unitBlocks[0].id}`);
const container = await waitFor(() => loadContainer());
const container = await loadContainer();

const sequenceNavButtons = container.querySelectorAll('nav.sequence-navigation a, nav.sequence-navigation button');
const sequenceNextButton = sequenceNavButtons[4];
Expand Down

0 comments on commit 0863345

Please sign in to comment.