How do I write a test to activate the save button when I choose a date in the datepicker and the onclick function, which holds a state?here is a code snippet....
if (selectedDate?.filter((e: any) => e.employeeId === employeeId).length > 0) {
setSelectedDate(selectedDate.map((e: any) => {
if (e.employeeId === employeeId) {
return { ...e, workAnniversary: value }
}
else {
return { ...e }
}
}))
}
else {
setSelectedDate([...selectedDate, { employeeId: employeeId, workAnniversary: value }])
}
setIsDisabled(false);
};