@7365admin1/module-hygiene 4.29.1-staging.17 → 4.29.1-staging.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@7365admin1/module-hygiene",
3
3
  "license": "MIT",
4
- "version": "4.29.1-staging.17",
4
+ "version": "4.29.1-staging.18",
5
5
  "author": "7365admin1",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -22,3 +22,9 @@ test("history PDF labels not-done items Missed, done ones not", () => {
22
22
  assert.equal((html.match(/<span class="missed-label">Missed<\/span>/g) || []).length, 1);
23
23
  assert.match(html, /Nothing <span class="missed-label">/);
24
24
  });
25
+
26
+ test("one extra visit is one more round, even for an area with several visits a day", () => {
27
+ const sets = buildScheduleTaskSets({ _id: "t1", title: "Lunch toilet check", time: "14:00" }, [{ name: "u" }], 4);
28
+ assert.equal(sets.length, 1);
29
+ assert.equal(sets[0].set, 4);
30
+ });
@@ -183,3 +183,16 @@ test("a row with no / null time never throws and has no next run", () => {
183
183
  }
184
184
  assert.doesNotThrow(() => scheduleDisplay({ time: null, dates: null, repeat: "weekly" }, now));
185
185
  });
186
+
187
+ test("edit: a repeating task carries no dates; a one-off without a date is refused in plain words", () => {
188
+ const now = at("2026-10-20T10:00");
189
+ // what the web and mobile forms send when a task repeats: dates []
190
+ assert.equal(validateScheduleRules({ ...base, repeat: "weekly", daysOfWeek: [1, 3], startDate: "2026-10-20", dates: [] }, now), null);
191
+ assert.equal(validateScheduleRules({ ...base, repeat: "none", dates: [] }, now), "Pick at least one date, or choose a repeat.");
192
+ });
193
+
194
+ test("next visit is not 'today' for a task saved after today's time", () => {
195
+ const now = at("2026-10-20T21:00");
196
+ const saved = { time: "09:00", repeat: "daily", startDate: "2026-10-20", dates: [], createdAt: at("2026-10-20T20:00") };
197
+ assert.equal(nextRun(saved, now), "2026-10-21T09:00:00+08:00");
198
+ });