From 8b8c90e2744d09f0fcec6378190f079a7a7bf42e Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Thu, 31 Oct 2024 15:51:07 -0500 Subject: [PATCH] Add tests --- .../Task/Modal/Form/TaskModalForm.test.tsx | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/components/Task/Modal/Form/TaskModalForm.test.tsx b/src/components/Task/Modal/Form/TaskModalForm.test.tsx index f4a67f47d..a3fb3529f 100644 --- a/src/components/Task/Modal/Form/TaskModalForm.test.tsx +++ b/src/components/Task/Modal/Form/TaskModalForm.test.tsx @@ -365,6 +365,55 @@ describe('TaskModalForm', () => { ); }); + it('defaults the subject to the defaultValues subject', () => { + const { getByRole } = render( + + + + + + + , + ); + + expect(getByRole('textbox', { name: 'Subject' })).toHaveValue( + 'Do something', + ); + }); + + it('defaults the subject to the name based on phase and action', () => { + const { getByRole } = render( + + + + + + + , + ); + + expect(getByRole('textbox', { name: 'Subject' })).toHaveValue( + 'Text Message Partner For Cultivation', + ); + }); + it('renders fields for completed task', async () => { const { getByRole, findByRole, queryByText } = render(