mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): simplify monthly schedule warning
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -28,16 +28,9 @@ const WEEKDAYS = [
|
||||
const MONTH_DAYS = Array.from({ length: 31 }, (_, index) => String(index + 1));
|
||||
|
||||
function monthlyDayWarning(monthDay: string): string | null {
|
||||
switch (monthDay) {
|
||||
case "29":
|
||||
return "Day 29 does not occur in February every year, so this schedule will occasionally skip a month.";
|
||||
case "30":
|
||||
return "Day 30 does not occur in February, so this schedule will skip February.";
|
||||
case "31":
|
||||
return "Day 31 does not occur in every month, so this schedule will skip shorter months.";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return Number(monthDay) > 28
|
||||
? "This schedule won’t run in some months."
|
||||
: null;
|
||||
}
|
||||
|
||||
function customCronSeed(schedule: ScheduleFormState): string {
|
||||
|
||||
@@ -145,9 +145,7 @@ test("configures common schedules and exposes custom cron", async ({
|
||||
await inspector.getByText("Monthly", { exact: true }).click();
|
||||
await inspector.getByLabel("Day of month").selectOption("31");
|
||||
await expect(
|
||||
inspector.getByText(
|
||||
"Day 31 does not occur in every month, so this schedule will skip shorter months.",
|
||||
),
|
||||
inspector.getByText("This schedule won’t run in some months."),
|
||||
).toBeVisible();
|
||||
await dialog.getByRole("tab", { name: "YAML" }).click();
|
||||
await expect(dialog.getByLabel("Workflow YAML")).toHaveValue(
|
||||
|
||||
Reference in New Issue
Block a user