@7365admin1/module-hygiene 4.29.1-staging.16 → 4.29.1-staging.17
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/.changeset/schedule-task-set-fields.md +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +45 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/test/schedule-followups.test.mjs +24 -0
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.
|
|
4
|
+
"version": "4.29.1-staging.17",
|
|
5
5
|
"author": "7365admin1",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
14
14
|
"release": "yarn run build && changeset publish",
|
|
15
15
|
"lint": "tsc",
|
|
16
|
-
"test": "tsup src/utils/hygiene-dashboard-metrics.util.ts src/utils/hygiene-checkout-decision.util.ts src/utils/completion-photo.util.ts src/utils/area-unit.util.ts src/utils/escape-regex.util.ts src/utils/schedule-task-rules.util.ts --format esm --out-dir test/.build --no-dts --silent && node --test \"test/*.test.mjs\""
|
|
16
|
+
"test": "tsup src/utils/hygiene-dashboard-metrics.util.ts src/utils/hygiene-checkout-decision.util.ts src/utils/completion-photo.util.ts src/utils/area-unit.util.ts src/utils/escape-regex.util.ts src/utils/schedule-task-rules.util.ts src/utils/schedule-task-set.util.ts src/utils/checklist-pdf-html.util.ts --format esm --out-dir test/.build --no-dts --silent && node --test \"test/*.test.mjs\""
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@changesets/cli": "^2.26.0",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { test } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { buildScheduleTaskSets } from "./.build/schedule-task-set.util.mjs";
|
|
4
|
+
import { buildChecklistHtml } from "./.build/checklist-pdf-html.util.mjs";
|
|
5
|
+
|
|
6
|
+
test("extra-visit sets carry task id, title and time", () => {
|
|
7
|
+
const sets = buildScheduleTaskSets(
|
|
8
|
+
{ _id: "t1", title: "Toilet re-clean", time: "14:30" }, [{ name: "u" }], 3, 2);
|
|
9
|
+
assert.equal(sets.length, 2);
|
|
10
|
+
assert.deepEqual(sets.map((s) => s.set), [3, 4]);
|
|
11
|
+
for (const s of sets) {
|
|
12
|
+
assert.equal(s.isScheduleTask, true);
|
|
13
|
+
assert.equal(s.scheduleTaskId, "t1");
|
|
14
|
+
assert.equal(s.scheduleTaskTitle, "Toilet re-clean");
|
|
15
|
+
assert.equal(s.scheduleTaskTime, "14:30");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("history PDF labels not-done items Missed, done ones not", () => {
|
|
20
|
+
const html = buildChecklistHtml([{ name: "A", type: "common", status: "open", checklist: [
|
|
21
|
+
{ set: 1, units: [{ name: "Done", approve: true }, { name: "Failed", reject: true }, { name: "Nothing" }] }] }]);
|
|
22
|
+
assert.equal((html.match(/<span class="missed-label">Missed<\/span>/g) || []).length, 1);
|
|
23
|
+
assert.match(html, /Nothing <span class="missed-label">/);
|
|
24
|
+
});
|