Highlight task planner items near reset
All checks were successful
Deploy Sokko G / deploy (push) Successful in 14s

This commit is contained in:
Shinuwa 2026-08-20 16:42:41 +02:00
parent 49ba0c4cb2
commit e4cbe3e087
5 changed files with 80 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import { readFile } from "node:fs/promises";
import { test } from "node:test";
import assert from "node:assert/strict";
import { SOCKET_SHAPES, formatValue, getSocketItemName, setItemCategory } from "../website/src/features/toolboxes/modules/equipmentPlannerOptions.js";
import { applyDueResets, getTaskParentMap, getTaskTreeIds, moveTask } from "../website/src/features/toolboxes/modules/taskPlannerUtils.js";
import { applyDueResets, getTaskParentMap, getTaskTreeIds, isTaskResetSoon, moveTask } from "../website/src/features/toolboxes/modules/taskPlannerUtils.js";
import { createInput, getInputLabel, normalizeCustomKey, parseHoldSeconds } from "../website/src/features/toolboxes/modules/combosUtils.js";
import { getBoundsFromStartAndSize, getSelectionBounds, moveSelectionCells, parseTsvBlock, pasteCellBlock } from "../website/src/features/toolboxes/modules/tableUtils.js";
import { canToggleAutoRefresh, getCountdownValidationError, isAlertGuarded } from "../website/src/features/toolboxes/modules/timerOptions.js";
@ -471,6 +471,11 @@ test("task planner helpers keep hierarchy, reorder and reset behavior stable", (
lastResetAt: Date.UTC(2026, 0, 1, 5)
}, Date.UTC(2026, 0, 2, 8));
assert.equal(resetData.tasks.find((task) => task.id === "a").checked, false);
assert.equal(isTaskResetSoon({ id: "d", title: "D", type: "daily", checked: false }, resetData, new Date(2026, 0, 2, 0, 1).getTime()), true);
assert.equal(isTaskResetSoon({ id: "e", title: "E", type: "daily", checked: false }, resetData, new Date(2026, 0, 1, 20, 0).getTime()), false);
assert.equal(isTaskResetSoon({ id: "f", title: "F", type: "weekly", checked: false, weeklyResetDay: 4 }, resetData, new Date(2026, 0, 6, 7, 0).getTime()), true);
assert.equal(isTaskResetSoon({ id: "g", title: "G", type: "weekly", checked: true, weeklyResetDay: 4 }, resetData, new Date(2026, 0, 6, 7, 0).getTime()), false);
assert.equal(isTaskResetSoon({ id: "h", title: "H", type: "unique", checked: false }, resetData, new Date(2026, 0, 6, 7, 0).getTime()), false);
});
test("equipment planner options expose stable formatting and socket helpers", () => {