diff --git a/src/app/components/elements/modals/SetAssignmentsModal.tsx b/src/app/components/elements/modals/SetAssignmentsModal.tsx index 55b3a501e1..3d4c83298a 100644 --- a/src/app/components/elements/modals/SetAssignmentsModal.tsx +++ b/src/app/components/elements/modals/SetAssignmentsModal.tsx @@ -49,7 +49,7 @@ const AssignGroup = ({groups, currentAssignees, board, closeModal}: AssignGroupP const [selectedGroups, setSelectedGroups] = useState[]>([]); const [dueDate, setDueDate] = useState(UTC_MIDNIGHT_IN_SIX_DAYS); const [userSelectedDueDate, setUserSelectedDueDate] = useState(false); - const [scheduledStartDate, setScheduledStartDate] = useState(); + const [scheduledStartDate, setScheduledStartDate] = useState(TODAY); const [assignmentNotes, setAssignmentNotes] = useState(); const [validationAttempted, setValidationAttempted] = useState(false); const user = useAppSelector(selectors.user.loggedInOrNull); @@ -66,7 +66,7 @@ const AssignGroup = ({groups, currentAssignees, board, closeModal}: AssignGroupP } function assign() { - dispatch(assignGameboard({ + void dispatch(assignGameboard({ boardId: board?.id as string, groups: selectedGroups, dueDate, diff --git a/src/test/pages/SetAssignments.test.tsx b/src/test/pages/SetAssignments.test.tsx index 038b3e580f..8d25de833a 100644 --- a/src/test/pages/SetAssignments.test.tsx +++ b/src/test/pages/SetAssignments.test.tsx @@ -213,7 +213,7 @@ describe("SetAssignments", () => { expect(requestAssignment(observer.observedParams!).gameboardId).toEqual(mockGameboard.id); expect(requestAssignment(observer.observedParams!).notes).toEqual(testNotes); expect(requestAssignment(observer.observedParams!).dueDate).toBeDefined(); - expect(requestAssignment(observer.observedParams!).scheduledStartDate).not.toBeDefined(); + expect(requestAssignment(observer.observedParams!).scheduledStartDate).toBeDefined(); }); // Close modal @@ -243,9 +243,11 @@ describe("SetAssignments", () => { expect(within(await modal()).getByTestId("modal-groups-selector")).toHaveTextContent('Groups:None'); }); - it('start date is empty by default', async () => { - await renderModal(); - expect(await dateInput("modal-start-date-selector")).toHaveValue(''); + it('start date is today by default', async () => { + await withMockedDate(Date.parse("2025-01-30"), async () => { + await renderModal(); + expect(await dateInput("modal-start-date-selector")).toHaveValue("2025-01-30"); + }); }); it('due date is a week from now by default', async() => {