Fragnet: reads checked against a live account; interval and one-off schedules

Inspect on a real Fragnet panel showed every read answers as the reader expects. Schedules that run every so often or once (interval_value, interval_unit, run_at) carry no cron fields, so they were shown as a cron of stars; they now read "every 6 hours" or "once, ...", and the page hides an empty label. Test and INTEGRATIONS.md updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-17 19:19:48 +01:00
1 parent 01fb5d6335
commit a91efcbfe2
4 files changed
+31 -5

No files matched your search

+11
View File
@@ -136,6 +136,17 @@ describe("what the panel's API says", () => {
assert.deepEqual([s.id, s.name, s.cron, s.active, s.onlyWhenOnline, s.nextRunAt], [4, "Nightly restart", "0 4 * * *", true, true, "2026-06-02T04:00:00.000Z"]);
});
test("a schedule that runs every so often or once is not shown as a cron of stars", () => {
const run = (attributes: Record<string, unknown>) => adapter.parseSchedules({ data: [{ attributes: { id: 1, name: "x", ...attributes } }] })[0].cron;
const none = { minute: "", hour: "", day_of_month: "", month: "", day_of_week: "" };
assert.equal(run({ cron: none, has_interval: true, interval_value: 6, interval_unit: "hours", run_at: "2026-06-02T04:00:00+00:00" }), "every 6 hours");
assert.equal(run({ cron: {}, has_interval: true, interval_value: 1, interval_unit: "hour" }), "every hour");
assert.equal(run({ cron: none, has_interval: false, run_at: "2026-06-02T04:00:00+00:00" }), "once, 2026-06-02 04:00");
assert.equal(run({ cron: none }), "", "nothing known says nothing");
assert.equal(run({ cron: { minute: "*/5", hour: "*", day_of_month: "*", month: "*", day_of_week: "*" } }), "*/5 * * * *");
assert.equal(run({ cron: { minute: "0", hour: "4" } }), "0 4 * * *", "a cron with fields left out keeps its stars");
});
test("the next page is the one after this, up to the last", () => {
assert.equal(adapter.nextPage({ meta: { pagination: { current_page: 1, total_pages: 2 } } }), 2);
assert.equal(adapter.nextPage({ meta: { pagination: { current_page: 2, total_pages: 2 } } }), null);