test: fixed test cases

This commit is contained in:
sundasnoreen12
2025-07-16 18:22:53 +05:00
parent 258a9b51b3
commit a6b14740ea

View File

@@ -110,6 +110,10 @@ describe('PostEditor', () => {
allowAnonymous,
allowAnonymousToPeers,
moderationSettings: {},
captchaSettings: {
enabled: false,
siteKey: '',
},
},
});
await executeThunk(fetchCourseTopics(courseId), store.dispatch, store.getState);
@@ -119,7 +123,6 @@ describe('PostEditor', () => {
allowAnonymousToPeers ? '' : 'not'} allowed`, async () => {
await renderComponent();
expect(screen.queryByRole('heading')).toHaveTextContent('Add a post');
expect(screen.queryAllByRole('radio')).toHaveLength(2);
// 2 categories with 4 subcategories each
expect(screen.queryAllByText(/category-\d-topic \d/)).toHaveLength(8);
@@ -162,6 +165,10 @@ describe('PostEditor', () => {
provider: 'legacy',
is_notify_all_learners_enabled: isNotifyAllLearnersEnabled,
moderationSettings: {},
captchaSettings: {
enabled: false,
siteKey: '',
},
},
});
@@ -202,6 +209,10 @@ describe('PostEditor', () => {
...settings,
},
...config,
captchaSettings: {
enabled: false,
siteKey: '',
},
},
});
await executeThunk(fetchCourseTopics(courseId), store.dispatch, store.getState);
@@ -358,6 +369,10 @@ describe('PostEditor', () => {
dividedInlineDiscussions: dividedcw,
dividedCourseWideDiscussions: dividedncw,
},
captchaSettings: {
enabled: false,
siteKey: '',
},
},
});
await executeThunk(fetchCourseTopics(courseId), store.dispatch, store.getState);