From e89cf91f8cd7942a0994ac3d4b03c346978b203b Mon Sep 17 00:00:00 2001 From: Maria Afonina <104988390+MariaAfonina@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:56:33 +0200 Subject: [PATCH] Added tests --- .../CreateOrEditQuizContainer.spec.jsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/unit/containers/my-quizzes/CreateOrEditQuizContainer.spec.jsx b/tests/unit/containers/my-quizzes/CreateOrEditQuizContainer.spec.jsx index 033a0a0fa..950d110f2 100644 --- a/tests/unit/containers/my-quizzes/CreateOrEditQuizContainer.spec.jsx +++ b/tests/unit/containers/my-quizzes/CreateOrEditQuizContainer.spec.jsx @@ -41,4 +41,28 @@ describe('CreateOrEditQuizContainer', () => { expect(setTitle).toHaveBeenCalled() expect(setDescription).toHaveBeenCalled() }) + + it('should render create new question form', () => { + const btnAddQuestion = screen.getByText( + 'myResourcesPage.quizzes.createNewQuestion' + ) + + fireEvent.click(btnAddQuestion) + + const formTitle = screen.getByText(/title:/i) + + expect(formTitle).toBeInTheDocument() + }) + + it('should render add questions form', () => { + const btnAddNewQuestion = screen.getByText( + 'myResourcesPage.quizzes.addQuestion' + ) + + fireEvent.click(btnAddNewQuestion) + + const formTitle = screen.getByText('myResourcesPage.questions.add') + + expect(formTitle).toBeInTheDocument() + }) })