Гант: пунктир от вехи до красной черты; опоздавшая веха справа от черты с красным контуром
All checks were successful
ci / test (push) Successful in 25s
ci / deploy (push) Successful in 1m32s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 17:11:02 +03:00
parent abfc459e2a
commit c178b64ac0
2 changed files with 22 additions and 3 deletions

View File

@@ -195,6 +195,20 @@ describe("computeSchedule", () => {
expect(svg.split('stroke="#d32f2f" stroke-width="3"').length - 1).toBe(3); // черта у CP-5, в сводной полосе группы и знак в легенде
expect(svg).toContain("Крайний срок: день 75");
expect(svg).toContain("Крайний срок: CP-5, день 75"); // и в сводной полосе группы
expect(svg).toContain('stroke="#d32f2f" stroke-width="1" stroke-dasharray="3 3"'); // пунктир от ромба до красной черты
expect(svg).not.toContain('stroke="#d32f2f" stroke-width="2.5"'); // опоздавшей вехи нет
});
it("веха правее крайнего срока: ромб остаётся справа от черты и обведён красным", () => {
const rows = [
row({ id: "CP-0", stage: "S", date_constraint: "день 0" }),
row({ id: "S-1", stage: "S", depends_on: "CP-0", duration: "20d" }),
row({ id: "CP-5", stage: "S", depends_on: "S-1", date_constraint: "не позже дня 7" }),
];
const sc = computeSchedule(rows);
expect(sc.timings.get("CP-5")).toMatchObject({ end: 20, deadline: 7 });
const svg = renderGantt({ ...model, rows }, sc, {});
expect(svg).toContain('stroke="#d32f2f" stroke-width="2.5"'); // красный контур ромба
});
it("повторяющиеся шаги тянутся до конца проекта и не считаются предшественниками", () => {