new person registration + car body matching accident date with endDate

This commit is contained in:
2026-11-21 12:47:50 +03:30
parent 5c6e21dd14
commit ab3ae53ec0
8 changed files with 462 additions and 27 deletions
+17
View File
@@ -77,3 +77,20 @@ test("flow UI includes every seed expert in each assigned branch and both Kazemi
assert.equal(kazemi.tp, "3992");
assert.equal(kazemi.body, "3991");
});
test("hull flow derives all three licence replacement states from dates", () => {
const script = fs.readFileSync(path.join(__dirname, "fanavaran-flow-test.sh"), "utf8");
const start = script.indexOf('const e=process.env, n=(k)=>Number(e[k]), nullable=');
const builder = script.slice(start, script.indexOf('\nNODE', start));
for (const [issue, expected] of [
["1404/08/24", 0], ["1401/08/24", null], ["1394/08/24", 1],
["1402/08/24", 0], ["1395/08/24", null],
]) {
let output = "";
vm.runInNewContext(builder, { process: {
env: { POLICE_REPORT_DESC: "شرح حادثه", CULPRIT_LICENCE_ISSU_DATE: issue, ACCIDENT_DATE: "1405/08/24" },
stdout: { write: text => { output += text; } },
} });
assert.equal(JSON.parse(output).IsLicenseReplaced, expected, issue);
}
});