feat: add lead qualification workflow
This commit is contained in:
@@ -2,6 +2,14 @@ import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
getLeadBlacklistStatusLabel,
|
||||
getLeadContactStatusLabel,
|
||||
getLeadDuplicateStatusLabel,
|
||||
getLeadPriorityLabel,
|
||||
leadBlacklistStatusOptions,
|
||||
leadContactStatusOptions,
|
||||
leadDuplicateStatusOptions,
|
||||
leadPriorityOptions,
|
||||
dashboardKpis,
|
||||
dashboardNavigation,
|
||||
groupLeadFunnelCards,
|
||||
@@ -138,6 +146,49 @@ test("groupLeadFunnelCards derives review, follow-up, and deferred columns witho
|
||||
);
|
||||
});
|
||||
|
||||
test("toLeadFunnelCard maps blocked priority to deferred stage with blocker label", () => {
|
||||
const card = toLeadFunnelCard({
|
||||
id: "lead-blocked",
|
||||
companyName: "Sperr Beispiel",
|
||||
city: "Freiburg",
|
||||
priority: "blocked",
|
||||
contactStatus: "new",
|
||||
blacklistStatus: "blocked",
|
||||
});
|
||||
|
||||
assert.equal(card.stageId, "deferred");
|
||||
assert.equal(card.priorityLabel, "Gesperrt");
|
||||
assert.equal(card.nextAction, "Zurückstellung prüfen");
|
||||
});
|
||||
|
||||
test("dashboard-model exposes stable lead label helpers for UI mapping", () => {
|
||||
assert.deepEqual(leadPriorityOptions, [
|
||||
"high",
|
||||
"medium",
|
||||
"low",
|
||||
"defer",
|
||||
"blocked",
|
||||
]);
|
||||
assert.equal(getLeadPriorityLabel("high"), "Hoch");
|
||||
assert.equal(getLeadContactStatusLabel("missing_contact"), "Kontakt fehlt");
|
||||
assert.equal(getLeadBlacklistStatusLabel("blocked"), "Gesperrt");
|
||||
});
|
||||
|
||||
test("dashboard-model exposes duplicate status options and labels", () => {
|
||||
assert.deepEqual(leadDuplicateStatusOptions, [
|
||||
"unchecked",
|
||||
"unique",
|
||||
"possible_duplicate",
|
||||
"duplicate",
|
||||
]);
|
||||
assert.equal(getLeadDuplicateStatusLabel("duplicate"), "Duplikat");
|
||||
});
|
||||
|
||||
test("dashboard-model exposes contact status options for lead review controls", () => {
|
||||
assert.equal(leadContactStatusOptions[1], "missing_contact");
|
||||
assert.equal(leadBlacklistStatusOptions.length, 2);
|
||||
});
|
||||
|
||||
test("dashboardKpis and reviewQueue expose the above-the-fold dashboard summary", () => {
|
||||
assert.equal(dashboardKpis.length, 4);
|
||||
assert.equal(reviewQueue.length, 3);
|
||||
|
||||
Reference in New Issue
Block a user