Skip to content

Commit 94d0ed9

Browse files
committed
fix: Broken test
1 parent 931d0d8 commit 94d0ed9

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

src/course-outline/OutlineAddChildButtons.test.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,25 @@ jest.mock('@src/course-outline/outline-sidebar/OutlineSidebarContext', () => ({
8989
await userEvent.click(newBtn);
9090
switch (containerType) {
9191
case ContainerType.Section:
92-
await waitFor(() => expect(handleAddBlock.mutateAsync).toHaveBeenCalledWith({
93-
type: ContainerType.Chapter,
94-
parentLocator: courseUsageKey,
95-
displayName: 'Section',
96-
}));
92+
await waitFor(() => expect(handleAddBlock.mutateAsync).toHaveBeenCalledWith(
93+
{
94+
type: ContainerType.Chapter,
95+
parentLocator: courseUsageKey,
96+
displayName: 'Section',
97+
},
98+
expect.objectContaining({ onSuccess: expect.any(Function) }),
99+
));
97100
break;
98101
case ContainerType.Subsection:
99-
await waitFor(() => expect(handleAddBlock.mutateAsync).toHaveBeenCalledWith({
100-
type: ContainerType.Sequential,
101-
parentLocator,
102-
displayName: 'Subsection',
103-
sectionId: parentLocator,
104-
}));
102+
await waitFor(() => expect(handleAddBlock.mutateAsync).toHaveBeenCalledWith(
103+
{
104+
type: ContainerType.Sequential,
105+
parentLocator,
106+
displayName: 'Subsection',
107+
sectionId: parentLocator,
108+
},
109+
expect.objectContaining({ onSuccess: expect.any(Function) }),
110+
));
105111
break;
106112
case ContainerType.Unit:
107113
await waitFor(() => expect(handleAddAndOpenUnit.mutateAsync).toHaveBeenCalledWith({

0 commit comments

Comments
 (0)