keepsafe rework & alert ajustments
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
This commit is contained in:
parent
68005ef918
commit
2e6d8a2c0c
11 changed files with 129 additions and 45 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { parseColonImportLines } from "../website/src/features/toolboxes/modules/textImport.js";
|
||||
import { getTimePatternRecurrenceMs, getTimePatternTargetMs } from "../website/src/features/toolboxes/modules/timerUtils.js";
|
||||
|
||||
test("colon text import keeps urls intact after the first separator", () => {
|
||||
assert.deepEqual(parseColonImportLines("Build:https://example.com/build?class=rogue\nPotion:10"), [
|
||||
|
|
@ -15,3 +16,13 @@ test("colon text import accepts labels without value", () => {
|
|||
{ label: "Simple item", value: "" }
|
||||
]);
|
||||
});
|
||||
|
||||
test("time pattern recurrence uses configured frequency instead of next remaining delay", () => {
|
||||
const now = new Date(2026, 0, 1, 13, 23, 45, 0).getTime();
|
||||
const target = getTimePatternTargetMs("X:24:X", now);
|
||||
assert.equal(new Date(target).getHours(), 13);
|
||||
assert.equal(new Date(target).getMinutes(), 24);
|
||||
assert.equal(new Date(target).getSeconds(), 0);
|
||||
assert.equal(getTimePatternRecurrenceMs("X:24:X"), 60 * 60 * 1000);
|
||||
assert.equal(getTimePatternRecurrenceMs("X:X:30"), 60 * 1000);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue