Skip to content

Commit

Permalink
test: add wrapping to SectionCard test component
Browse files Browse the repository at this point in the history
  • Loading branch information
steff456 committed Dec 9, 2023
1 parent 9ad8fbe commit 6760328
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/course-outline/section-card/SectionCard.test.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { render, fireEvent } from '@testing-library/react';
import { IntlProvider } from '@edx/frontend-platform/i18n';
import { AppProvider } from '@edx/frontend-platform/react';
Expand Down Expand Up @@ -28,25 +30,25 @@ const section = {
const renderComponent = (props) => render(
<AppProvider store={store}>
<IntlProvider locale="en">
<SectionCard
section={section}
index={0}
onOpenPublishModal={jest.fn()}
onOpenHighlightsModal={jest.fn()}
onOpenDeleteModal={jest.fn()}
onEditClick={jest.fn()}
savingStatus=""
onEditSectionSubmit={jest.fn()}
onDuplicateSubmit={jest.fn()}
isSectionsExpanded
moveSection={jest.fn()}
finalizeSectionOrder={jest.fn()}
connectDragSource={(el) => el}
isDragging
{...props}
>
<span>children</span>
</SectionCard>
<DndProvider backend={HTML5Backend}>
<SectionCard
section={section}
index={0}
onOpenPublishModal={jest.fn()}
onOpenHighlightsModal={jest.fn()}
onOpenDeleteModal={jest.fn()}
onEditClick={jest.fn()}
savingStatus=""
onEditSectionSubmit={jest.fn()}
onDuplicateSubmit={jest.fn()}
isSectionsExpanded
moveSection={jest.fn()}
finalizeSectionOrder={jest.fn()}
{...props}
>
<span>children</span>
</SectionCard>
</DndProvider>
</IntlProvider>,
</AppProvider>,
);
Expand Down

0 comments on commit 6760328

Please sign in to comment.