You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that Datepicker-react did not have useEffect() for initialDate and hence, it was not updated after re-initialisation of the value. So, this has been fixed. Plus, @piofinn noticed the unit test written above had a bug as well. See his fix below:
`
it("should change date on new props", () => {
// New date takes MM.DD.YYYY values
const { container, getByTestId } = render(<DatePicker initialDate={new Date("02.02.2019")} />);
render(<DatePicker initialDate={new Date("09.12.2019")} />, { container });
const input = getByTestId("jkl-datepicker__input");
// Check for date formatted as DD.MM.YYYY
expect(input).toHaveProperty("value", "12.09.2019");
});
testing-library/react-testing-library#65 (comment)
The text was updated successfully, but these errors were encountered: