PEP-174: тест паузы под одно напоминание через 4 ч в рабочее время (PEP-173)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
114cd5b6d8
commit
a12005dc7b
@ -155,8 +155,9 @@ describe("Пауза проекта", () => {
|
||||
const q = await core.askPm(db, ref, { kind: "question", text: "Какой цвет кнопки?", options: ["Синий", "Зелёный"], msgType: "question", defaultOption: "Синий" });
|
||||
await core.sendProjectMessage(db, p.id, "Агент переключился на другую подписку", `mock-pause:${p.id}`, { title: "x", url: "/" });
|
||||
await runner.notifyPm(db, p.id, `mock-pause-notify:${p.id}`, "Задача закрыта автоматически");
|
||||
// Forty minutes later a reminder would be due (remindMin 30).
|
||||
await runner.remindTick(db, { now: new Date(Date.now() + 40 * MIN), cfg: await runner.getWatchdogSettings(db), log: () => {} });
|
||||
// Five hours later, in working time, a reminder would be due (one after 4 h, PEP-173).
|
||||
const cfg = { ...(await runner.getWatchdogSettings(db)), workFrom: 0, workTo: 24, workDays: [1, 2, 3, 4, 5, 6, 7] };
|
||||
await runner.remindTick(db, { now: new Date(Date.now() + 5 * 60 * MIN), cfg, log: () => {} });
|
||||
await new Promise((r) => setTimeout(r, 800)); // a few reconcile rounds of the bot
|
||||
assert.deepEqual(await outboxRows(), before, "nothing queued for the project");
|
||||
assert.equal((await core.getQuestion(db, q.id)).reminders, 0, "no reminder");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user