Skip to content

Commit 2b09be9

Browse files
author
Shreyas-Microsoft
committed
fix draft test case
1 parent 409a2ae commit 2b09be9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/frontend/src/pages/draft/Draft.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ describe('Draft Component', () => {
161161
expect(sectionCards.length).toBe(0)
162162
})
163163

164-
test('renders SectionCard for each section in draftedDocument', () => {
164+
test('renders SectionCard for each section in draftedDocument', async() => {
165165
renderComponent(mockAppState)
166166

167-
const sectionCards = screen.getAllByTestId('mock-section-card')
168-
expect(sectionCards.length).toBe(mockAppState.state.draftedDocument.sections.length)
167+
await waitFor(() => {
168+
const sectionCards = screen.getAllByTestId('mock-section-card');
169+
expect(sectionCards.length).toBe(mockAppState.state.draftedDocument.sections.length);
170+
});
169171
})
170172

171173
test('getTitle function returns correct title when draftedDocumentTitle is valid', () => {

0 commit comments

Comments
 (0)