Files
fusion/packages/engine/src/__tests__/node-dispatch-validation.test.ts
gsxdsm cb57093d03 refactor: domain folder layout (types, API, core, engine) (#2398)
## Summary

Wave 17 organizes Fusion into **domain folders** (stacks on #2397).

### Layout
- **core/types/** — board, task, agents, settings, merge, workflow,
mesh, …
- **core/src/** — agents, ai, async-stores, workflows, tasks, config,
db, …
- **dashboard/app/api/** — client, tasks, agents, git, missions,
planning, …
- **engine/src/** — agents, auth, execution, merge, missions, overseer,
worktree, …

Root keepers retained for large entrypoints (`store.ts`, `executor.ts`,
`merger.ts`, …).

Public barrels (`@fusion/core`, `@fusion/engine`, `app/api.ts` → legacy)
stay stable.

## Test plan
- [x] `@fusion/core` typecheck
- [x] `@fusion/engine` typecheck (pre-existing playwright-core noise
only)
- [ ] CI merge gate

**Stack:** #2394 → #2397 → **this PR**
2026-08-03 00:20:53 -07:00

29 lines
963 B
TypeScript

import { describe, expect, it } from "vitest";
import { validateProjectNodeMapping } from "../project/node-dispatch-validation.js";
describe("validateProjectNodeMapping", () => {
it("allows dispatch when mapping path is present", () => {
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: "/work/project" }),
).toEqual({ allowed: true });
});
it("blocks dispatch when mapping is missing or blank", () => {
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: undefined }),
).toEqual({
allowed: false,
code: "missing-project-mapping",
reason: "Execution blocked: project has no path mapping for node node-1",
});
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: " " }),
).toEqual({
allowed: false,
code: "missing-project-mapping",
reason: "Execution blocked: project has no path mapping for node node-1",
});
});
});