Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/components/elements/modals/SetAssignmentsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const AssignGroup = ({groups, currentAssignees, board, closeModal}: AssignGroupP
const [selectedGroups, setSelectedGroups] = useState<Item<number>[]>([]);
const [dueDate, setDueDate] = useState<Date | undefined>(UTC_MIDNIGHT_IN_SIX_DAYS);
const [userSelectedDueDate, setUserSelectedDueDate] = useState<boolean>(false);
const [scheduledStartDate, setScheduledStartDate] = useState<Date>();
const [scheduledStartDate, setScheduledStartDate] = useState<Date>(TODAY);
const [assignmentNotes, setAssignmentNotes] = useState<string>();
const [validationAttempted, setValidationAttempted] = useState<boolean>(false);
const user = useAppSelector(selectors.user.loggedInOrNull);
Expand All @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions src/test/pages/SetAssignments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() => {
Expand Down
Loading