From b0ccfdafb0880cb57a50e7ef203e5bd6170a235e Mon Sep 17 00:00:00 2001 From: AhtishamShahid Date: Wed, 22 Feb 2023 18:41:55 +0500 Subject: [PATCH] test: added unit-test for post editor --- src/discussions/posts/post-editor/PostEditor.test.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/discussions/posts/post-editor/PostEditor.test.jsx b/src/discussions/posts/post-editor/PostEditor.test.jsx index 8f2f82c2..db9a67f8 100644 --- a/src/discussions/posts/post-editor/PostEditor.test.jsx +++ b/src/discussions/posts/post-editor/PostEditor.test.jsx @@ -141,6 +141,16 @@ describe('PostEditor', () => { } }, ); + test('selectThread is not called while creating a new post', async () => { + const mockSelectThread = jest.fn(); + jest.mock('../data/selectors', () => ({ + selectThread: mockSelectThread, + })); + await renderComponent(); + expect(mockSelectThread) + .not + .toHaveBeenCalled(); + }); }); describe('cohorting', () => {