feat(KB-228): add schedule time presets
- Add morning, afternoon, evening, and night preset schedules to core automation types - Update ScheduleForm with preset selection dropdown and time handling - Add color coding for different schedule types in ScheduleCard - Add tests for new schedule preset functionality - Include changeset for release tracking
This commit is contained in:
@@ -136,6 +136,27 @@ describe("ScheduleForm", () => {
|
||||
const cronField = screen.getByLabelText("Cron Expression") as HTMLInputElement;
|
||||
expect(cronField.value).toBe("0 * * * *");
|
||||
});
|
||||
|
||||
it("auto-fills cron expression for every15Minutes preset", () => {
|
||||
render(<ScheduleForm onSubmit={onSubmit} onCancel={onCancel} />);
|
||||
fireEvent.change(screen.getByLabelText("Schedule"), { target: { value: "every15Minutes" } });
|
||||
const cronField = screen.getByLabelText("Cron Expression") as HTMLInputElement;
|
||||
expect(cronField.value).toBe("*/15 * * * *");
|
||||
});
|
||||
|
||||
it("auto-fills cron expression for every6Hours preset", () => {
|
||||
render(<ScheduleForm onSubmit={onSubmit} onCancel={onCancel} />);
|
||||
fireEvent.change(screen.getByLabelText("Schedule"), { target: { value: "every6Hours" } });
|
||||
const cronField = screen.getByLabelText("Cron Expression") as HTMLInputElement;
|
||||
expect(cronField.value).toBe("0 */6 * * *");
|
||||
});
|
||||
|
||||
it("auto-fills cron expression for weekdays preset", () => {
|
||||
render(<ScheduleForm onSubmit={onSubmit} onCancel={onCancel} />);
|
||||
fireEvent.change(screen.getByLabelText("Schedule"), { target: { value: "weekdays" } });
|
||||
const cronField = screen.getByLabelText("Cron Expression") as HTMLInputElement;
|
||||
expect(cronField.value).toBe("0 9 * * 1-5");
|
||||
});
|
||||
});
|
||||
|
||||
describe("submission", () => {
|
||||
|
||||
Reference in New Issue
Block a user