Skip to content

Commit c5bffb2

Browse files
committed
test: update XBlock publish state reset test
1 parent b674348 commit c5bffb2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/course-unit/CourseUnit.test.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,9 +2361,6 @@ describe('<CourseUnit />', () => {
23612361
});
23622362

23632363
it('resets XBlock publish state after saving XBlock changes', async () => {
2364-
store = initializeStore();
2365-
mockedUsedNavigate.mockClear();
2366-
23672364
axiosMock
23682365
.onGet(getCourseSectionVerticalApiUrl(blockId))
23692366
.reply(200, {
@@ -2377,13 +2374,15 @@ describe('<CourseUnit />', () => {
23772374

23782375
render(<RootWrapper />);
23792376

2380-
const xblocksIframe = await screen.findByTitle(xblockContainerIframeMessages.xblockIframeTitle.defaultMessage);
2381-
expect(xblocksIframe).toBeInTheDocument();
2377+
waitFor(() => {
2378+
const xblocksIframe = screen.findByTitle(xblockContainerIframeMessages.xblockIframeTitle.defaultMessage);
2379+
expect(xblocksIframe).toBeInTheDocument();
2380+
});
23822381

23832382
const courseUnitSidebar = await screen.findByTestId('course-unit-sidebar');
23842383

23852384
await waitFor(() => {
2386-
// Verify the publish button is present (indicates unpublished changes)
2385+
// Verify the publish button is present (indicates unpublished changes)
23872386
expect(within(courseUnitSidebar)
23882387
.getByRole('button', { name: sidebarMessages.actionButtonPublishTitle.defaultMessage })).toBeInTheDocument();
23892388

0 commit comments

Comments
 (0)