Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
added tests to account for previous schedule defect
Browse files Browse the repository at this point in the history
  • Loading branch information
delianides committed Jan 5, 2017
1 parent 6ea1274 commit 8ad5727
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions imports/blocks/add-to-cart/Schedule/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,16 @@ describe("Class", () => {
onDayClick(null, "tuesday", { selected: false });
expect(wrapper.state().start).toEqual("tuesday");
});
it("calls saveSchedule when a data is selected", () => {
const saveSchedule = jest.fn();
const wrapper = mount(generateComponent({ saveSchedule }));
wrapper.setState({ start: "custom", frequency: "monthly" });
const { onDayClick } = wrapper.instance();
onDayClick(null, "tuesday", { selected: true });
expect(saveSchedule).toBeCalledWith({
frequency: "monthly",
start: "tuesday",
});
});
});
});

0 comments on commit 8ad5727

Please sign in to comment.