fix(foundry): migrate legacy grid settings safely
This commit is contained in:
@@ -98,6 +98,32 @@ test("flat layouts migrate mode-aware extensions while explicit invalid hierarch
|
||||
);
|
||||
});
|
||||
|
||||
test("Robot2B legacy radius migrates per LOD without hiding the application", () => {
|
||||
const legacyRobot2BSettings = {
|
||||
gridHeightMeters: 500,
|
||||
gridLod1MaxHeightKm: 10,
|
||||
gridLod1StepKm: 1,
|
||||
gridLod2MaxHeightKm: 50,
|
||||
gridLod2StepKm: 5,
|
||||
gridLod3StepKm: 25,
|
||||
gridRadiusKm: 1_000,
|
||||
gridLineWidth: 4,
|
||||
gridColor: "#f5f5f5",
|
||||
gridOpacity: 12,
|
||||
gridDotsEnabled: true,
|
||||
gridDotsSize: 7,
|
||||
gridDotsColor: "#ffffff",
|
||||
gridDotsOpacity: 58,
|
||||
};
|
||||
const migrated = structuredClone(serverGrid.validateGridLodProfiles(
|
||||
serverGrid.promoteLegacyGridLodProfiles(legacyRobot2BSettings),
|
||||
));
|
||||
|
||||
assert.deepEqual(migrated.map((profile) => profile.radiusKm), [50, 1_000, 1_000, 1_000, 100]);
|
||||
assert.ok(migrated.every((profile) => profile.radiusKm / profile.stepKm <= 512));
|
||||
assert.ok(migrated.every((profile) => profile.graticuleLineWidthPx === 3));
|
||||
});
|
||||
|
||||
test("Foundry MCP exposes every persisted sector-v2 profile field", () => {
|
||||
for (const key of extensionKeys) assert.match(mcpSource, new RegExp(`\\b${key}: \\{`));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user