Гант: прокрутка колесом, Ctrl - горизонтально, Ctrl+Shift - масштаб, границы полотна; тест; docs
All checks were successful
ci / test (push) Successful in 19s
ci / deploy (push) Successful in 1m24s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 19:45:37 +03:00
parent 53df008f41
commit a4f338c5d1
3 changed files with 30 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
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 { buildApi } from "./http-api.js";
@@ -195,6 +196,15 @@ describe("Гант: группы, вехи, свёртывание, масшта
expect(svg).not.toContain("url(#hatch)");
});
it("страница: колесо - вертикальная прокрутка, Ctrl+колесо - горизонтальная, Ctrl+Shift+колесо - масштаб, границы полотна", () => {
const html = renderPage({ set: "khbuild", stages: [], warnings: [], rows: 0, questions: 0 });
expect(html).toContain("e.ctrlKey && e.shiftKey");
expect(html).toContain("ty -= e.deltaY"); // колесо - вертикально
expect(html).toContain("tx -= dd * lin"); // Ctrl+колесо - горизонтально
expect(html).toContain("function clamp()"); // границы полотна
expect(html).toContain("window.addEventListener('resize', place)");
});
it("масштаб времени меняет только ось: ширина растёт, шрифты и высота остаются", () => {
const a = renderGantt(ms, sch, { px: 5 });
const b = renderGantt(ms, sch, { px: 20 });