forked from Yara724/api
feat(flow-ui): load branch staff from parsian seeds
Load seeded staff and product-specific codes, preserve intentional missing-code markers, and disable options without codes.
This commit is contained in:
@@ -58,3 +58,22 @@ test("policy aliases used by existing inquiry mappings populate all three fields
|
||||
assert.equal(result.vehicle.BEGIN_DATE, "1404/02/01");
|
||||
assert.equal(result.vehicle.END_DATE, "1405/02/01");
|
||||
});
|
||||
|
||||
test("flow UI includes every seed expert in each assigned branch and both Kazemi codes", () => {
|
||||
const context = inquiryContext({});
|
||||
const branches = vm.runInContext("parsianBranchSeeds()", context);
|
||||
for (const [file, key, role] of [
|
||||
["file-makers.json", "fileMakers", "makers"],
|
||||
["file-reviewers.json", "fileReviewers", "reviewers"],
|
||||
]) {
|
||||
const seeds = JSON.parse(fs.readFileSync(path.join(__dirname, "data/parsian-tehran", file)))[key];
|
||||
for (const expert of seeds) {
|
||||
for (const location of expert.locations) {
|
||||
assert.ok(branches[location.id][role].some(r => r.name === `${expert.firstName} ${expert.lastName}`));
|
||||
}
|
||||
}
|
||||
}
|
||||
const kazemi = branches["210120"].reviewers.find(r => r.name.includes("کاظمي دولت سرا"));
|
||||
assert.equal(kazemi.tp, "3992");
|
||||
assert.equal(kazemi.body, "3991");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user