diff --git a/src/course-outline/section-card/SectionCard.test.tsx b/src/course-outline/section-card/SectionCard.test.tsx index ca5973b540..3acac9f91a 100644 --- a/src/course-outline/section-card/SectionCard.test.tsx +++ b/src/course-outline/section-card/SectionCard.test.tsx @@ -36,8 +36,8 @@ const subsection = { children: [{ id: unit.id, }], - }, -} as XBlock; + } as any, // 'as any' because we are omitting a lot of fields from 'childInfo' +} satisfies Partial as XBlock; const section = { id: '123', @@ -63,13 +63,14 @@ const section = { }], }, }], - }, + } as any, // 'as any' because we are omitting a lot of fields from 'childInfo' upstreamInfo: { readyToSync: true, upstreamRef: 'lct:org1:lib1:section:1', versionSynced: 1, + errorMessage: null, }, -} as XBlock; +} satisfies Partial as XBlock; const onEditSectionSubmit = jest.fn(); diff --git a/src/course-outline/subsection-card/SubsectionCard.test.tsx b/src/course-outline/subsection-card/SubsectionCard.test.tsx index 46acc2a81d..30dc5f7ac4 100644 --- a/src/course-outline/subsection-card/SubsectionCard.test.tsx +++ b/src/course-outline/subsection-card/SubsectionCard.test.tsx @@ -66,13 +66,14 @@ const subsection: XBlock = { children: [{ id: unit.id, }], - }, + } as any, // 'as any' because we are omitting a lot of fields from 'childInfo' upstreamInfo: { readyToSync: true, upstreamRef: 'lct:org1:lib1:subsection:1', versionSynced: 1, + errorMessage: null, }, -} as XBlock; +} satisfies Partial as XBlock; const section: XBlock = { id: '123', @@ -85,14 +86,14 @@ const section: XBlock = { children: [{ id: subsection.id, }], - }, + } as any, // 'as any' because we are omitting a lot of fields from 'childInfo' actions: { draggable: true, childAddable: true, deletable: true, duplicable: true, }, -} as XBlock; +} satisfies Partial as XBlock; const onEditSubectionSubmit = jest.fn(); diff --git a/src/course-outline/unit-card/UnitCard.test.tsx b/src/course-outline/unit-card/UnitCard.test.tsx index fe9fdb14fc..e102c2b9d3 100644 --- a/src/course-outline/unit-card/UnitCard.test.tsx +++ b/src/course-outline/unit-card/UnitCard.test.tsx @@ -31,7 +31,7 @@ const section = { deletable: true, duplicable: true, }, -} as XBlock; +} satisfies Partial as XBlock; const subsection = { id: '12', @@ -45,7 +45,7 @@ const subsection = { deletable: true, duplicable: true, }, -} as XBlock; +} satisfies Partial as XBlock; const unit = { id: '123', @@ -65,8 +65,9 @@ const unit = { readyToSync: true, upstreamRef: 'lct:org1:lib1:unit:1', versionSynced: 1, + errorMessage: null, }, -} as XBlock; +} satisfies Partial as XBlock; const renderComponent = (props?: object) => render( ', () => { { blockType: 'Problem', count: 1 }, { blockType: 'Video', count: 0 }, ].forEach(({ blockType, count }) => { - const blockCount = screen.getByText(blockType).closest('div') as HTMLDivElement; + const blockCount = screen.getByText(blockType).closest('div')!; expect(within(blockCount).getByText(count.toString())).toBeInTheDocument(); }); }); diff --git a/src/library-authoring/component-info/ComponentPreview.test.tsx b/src/library-authoring/component-info/ComponentPreview.test.tsx index 6fc199fb6e..2594ee347d 100644 --- a/src/library-authoring/component-info/ComponentPreview.test.tsx +++ b/src/library-authoring/component-info/ComponentPreview.test.tsx @@ -39,7 +39,7 @@ describe('', () => { it('renders a preview of the component', async () => { initializeMocks(); render(); - const iframe = (await screen.findByTitle('Preview')) as HTMLIFrameElement; + const iframe = (await screen.findByTitle('Preview')); expect(iframe.src).toEqual(`http://localhost:18010/xblocks/v2/${usageKey}/embed/student_view/`); });