Гант: не рисовать зависимости, следующие из цепочки других (транзитивная редукция)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { renderPage } from "./html.js";
|
||||
import { renderAris } from "./aris.js";
|
||||
import { clampPx, placeLabels, renderGantt, stageOrder, summarizeGroup } from "./gantt.js";
|
||||
import { clampPx, placeLabels, redundantDependencies, renderGantt, stageOrder, summarizeGroup } from "./gantt.js";
|
||||
import { buildApi } from "./http-api.js";
|
||||
import { buildModel, describeResponsible, loadModel, mapRow, type ProcessModel } from "./model.js";
|
||||
import { computeSchedule, parseConstraint, parseDuration, parseDurationInfo } from "./schedule.js";
|
||||
@@ -332,6 +332,12 @@ describe("Гант: группы, вехи, свёртывание, масшта
|
||||
expect(arrows(renderGantt(ms, sch, {}))).toBeGreaterThan(arrows(shut));
|
||||
});
|
||||
|
||||
it("зависимость, следующая из цепочки других, не рисуется стрелкой (A→C при A→B→C)", () => {
|
||||
const rows = [row({ id: "A" }), row({ id: "B", depends_on: "A" }), row({ id: "C", depends_on: "B", depends_on2: "A" })];
|
||||
const redundant = redundantDependencies(rows);
|
||||
expect([...redundant]).toEqual(["A>C"]);
|
||||
});
|
||||
|
||||
it("подпись полосы - название работы (внутри полосы или над ней), id справа снизу, без дат", () => {
|
||||
const svg = renderGantt(ms, sch, { px: 20 });
|
||||
expect(svg).toContain('fill="#fff">Работа</text>'); // название внутри длинной полосы
|
||||
|
||||
Reference in New Issue
Block a user