Files
CapaKraken/packages/db/src/import-dispo-batch.test.ts
T
Hartmut 625a842d89 feat: dashboard overhaul, chargeability reports, dispo import enhancements, UI polish
Dashboard: expanded chargeability widget, resource/project table widgets
with sorting and filters, stat cards with formatMoney integration.

Chargeability: new report client with filtering, chargeability-bookings
use case, updated dashboard overview logic.

Dispo import: TBD project handling, parse-dispo-matrix improvements,
stage-dispo-projects resource value scores, new tests.

Estimates: CommercialTermsEditor component, commercial-terms engine
module, expanded estimate schemas and types.

UI: AppShell navigation updates, timeline filter/toolbar enhancements,
role management improvements, signin page redesign, Tailwind/globals
polish, SystemSettings SMTP section, anonymization support.

Tests: new router tests (anonymization, chargeability, effort-rule,
entitlement, estimate, experience-multiplier, notification, resource,
staffing, vacation).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-14 23:29:07 +01:00

52 lines
1.8 KiB
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { parseImportDispoBatchArgs } from "./import-dispo-batch.js";
test("parseImportDispoBatchArgs uses the agreed workbook defaults", () => {
const options = parseImportDispoBatchArgs([]);
assert.equal(options.allowTbdUnresolved, true);
assert.equal(options.importTbdProjects, false);
assert.equal(options.skipCommit, false);
assert.equal(options.strictSourceData, false);
assert.equal(options.previewUnresolvedLimit, 10);
assert.match(options.referenceWorkbookPath, /MandatoryDispoCategories_V3\.xlsx$/u);
assert.match(options.planningWorkbookPath, /DISPO_2026\.xlsx$/u);
assert.match(
options.chargeabilityWorkbookPath,
/20260309_Bi-Weekly_Chargeability_Reporting_Content_Production_V0\.943_4Hartmut\.xlsx$/u,
);
assert.match(options.rosterWorkbookPath ?? "", /MV_DispoRoster\.xlsx$/u);
assert.match(
options.costWorkbookPath ?? "",
/Resource Roster_MASTER_FY26_CJ_20251201\.xlsx$/u,
);
});
test("parseImportDispoBatchArgs applies operator overrides", () => {
const options = parseImportDispoBatchArgs([
"--planning-workbook",
"./custom-planning.xlsx",
"--notes",
"live test",
"--preview-unresolved",
"25",
"--skip-commit",
"--strict-source-data",
"--disallow-tbd",
"--import-tbd-projects",
"--no-roster",
"--no-cost",
]);
assert.match(options.planningWorkbookPath, /custom-planning\.xlsx$/u);
assert.equal(options.notes, "live test");
assert.equal(options.previewUnresolvedLimit, 25);
assert.equal(options.skipCommit, true);
assert.equal(options.strictSourceData, true);
assert.equal(options.allowTbdUnresolved, false);
assert.equal(options.importTbdProjects, true);
assert.equal(options.rosterWorkbookPath, undefined);
assert.equal(options.costWorkbookPath, undefined);
});