From ae313365ea9f89aa8c93a53fd9a5bf98bde1f153 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 5f6b61197..fd701d81f 100644 --- a/src/components/Task/Modal/Form/TaskModalForm.test.tsx +++ b/src/components/Task/Modal/Form/TaskModalForm.test.tsx @@ -371,6 +371,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( + 'Partner Care - Text Message', + ); + }); + it('renders fields for completed task', async () => { const { getByRole, findByRole, queryByText } = render(