diff --git a/packages/datetime/src/datePicker.tsx b/packages/datetime/src/datePicker.tsx index f08b0fc8d7..a5cdd9650c 100644 --- a/packages/datetime/src/datePicker.tsx +++ b/packages/datetime/src/datePicker.tsx @@ -246,7 +246,7 @@ export class DatePicker extends AbstractPureComponent", () => { assert.isTrue(onChange.calledOnce); }); + it("onChange fired when month is changed", () => { + const onChange = sinon.spy(); + const { getDay, clickNextMonth } = wrap(); + assert.isTrue(onChange.notCalled); + getDay().simulate("click"); + assert.isTrue(onChange.calledOnce, "expected onChange called"); + clickNextMonth(); + assert.isTrue(onChange.calledTwice, "expected onChange called again"); + }); + it("selected day updates are automatic", () => { const { assertSelectedDays, getDay } = wrap(); assertSelectedDays();