This repository has been archived on 2026-10-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
EveElectron/test/shell.test.mjs
2026-07-10 07:40:43 +01:00

31 lines
1.3 KiB
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { EveElectronShell } from "../src/eve-electron-shell.mjs";
const advertisement = {
schema: "gamecult.eve.provider_advertisement.v1",
providerId: "fixture.world",
surfaces: [{
surfaceId: "fixture.world.surface",
worldInteraction: {
projectionKind: "provider-authored-world-surface",
commandBoundary: "fixture.world.commands",
receiptSchema: "gamecult.eve.command_receipt.v1",
ownership: "provider-owns-world-state",
},
}],
};
const surface = {
schema: "gamecult.eve.surface.v1",
surface: { id: "fixture.world.surface", root: { id: "root", kind: "world.scene3d", children: [] } },
};
test("lowers a non-product interactive world and preserves provider command authority", () => {
const shell = new EveElectronShell({ clientId: "fixture-electron" });
const projection = shell.lowerSurface(surface, advertisement, "fixture.world.surface");
assert.equal(projection.providerId, "fixture.world");
assert.equal(projection.root.shellElementKind, "world-projection-node");
const command = shell.createCommandIntent(advertisement, "fixture.world.surface", "fixture.world.commands", {});
assert.equal(command.commandBoundary, "fixture.world.commands");
assert.equal(command.clientId, "fixture-electron");
});