feat(simulation): add worker-gated 3d polygon workspace
This commit is contained in:
@@ -19,6 +19,7 @@ let stopPolygonWorker;
|
||||
let PolygonWorkerContractError;
|
||||
let workspaceById;
|
||||
let workspacesForRoot;
|
||||
let rootsForCapabilities;
|
||||
|
||||
before(async () => {
|
||||
server = await createServer({
|
||||
@@ -43,7 +44,11 @@ before(async () => {
|
||||
stopPolygonWorker,
|
||||
PolygonWorkerContractError,
|
||||
} = await server.ssrLoadModule("/src/core/polygon/liveWorker.ts"));
|
||||
({ workspaceById, workspacesForRoot } = await server.ssrLoadModule("/src/productModel.ts"));
|
||||
({
|
||||
workspaceById,
|
||||
workspacesForRoot,
|
||||
rootsForCapabilities,
|
||||
} = await server.ssrLoadModule("/src/productModel.ts"));
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
@@ -218,7 +223,7 @@ function vehicleState(overrides = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
test("UI-0 route is direct-only and does not add Polygon to system navigation", () => {
|
||||
test("Polygon is a worker-gated product root and keeps a compatible direct route", () => {
|
||||
assert.deepEqual(resolvePolygonRunRoute("?workspace=polygon-run"), {
|
||||
active: true,
|
||||
runId: null,
|
||||
@@ -237,11 +242,25 @@ test("UI-0 route is direct-only and does not add Polygon to system navigation",
|
||||
resolvePolygonRunRoute("?workspace=polygon-run&run=../../etc").error,
|
||||
/некорректный/,
|
||||
);
|
||||
assert.equal(workspaceById("polygon-run-internal").internalOnly, true);
|
||||
assert.equal(workspaceById("polygon-run").root, "polygon");
|
||||
assert.equal(
|
||||
workspacesForRoot("system").some(({ id }) => id === "polygon-run-internal"),
|
||||
workspacesForRoot("polygon").some(({ id }) => id === "polygon-run"),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
workspacesForRoot("system").some(({ id }) => id === "polygon-run"),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
rootsForCapabilities({ polygonWorkerAvailable: false })
|
||||
.some(({ id }) => id === "polygon"),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
rootsForCapabilities({ polygonWorkerAvailable: true })
|
||||
.some(({ id }) => id === "polygon"),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("Polygon contracts decode path-free evidence and preserve the safety boundary", () => {
|
||||
|
||||
Reference in New Issue
Block a user