Thing/packages/eve-browser-lowering/test/browser-lowering.test.mjs
2026-07-09 10:28:22 +01:00

39 lines
1.3 KiB
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { createEveCommandIntent } from "../dist/index.js";
test("command intents use the active surface advertisement boundary", () => {
const intent = createEveCommandIntent("aetheria.daemon.editor.inspect", {
action: {
commandBoundary: "component.fallback.boundary",
receiptSchema: "component.fallback.receipt.v1",
target: "component.fallback.target",
},
}, {
activeSurfaceId: "aetheria.daemon.editor",
clientId: "browser.reference",
provider: {
providerId: "aetheria",
surfaces: [
{
surfaceId: "aetheria.daemon.game",
worldInteraction: {
commandBoundary: "aetheria.daemon.game.commands",
receiptSchema: "aetheria.game_receipt.v1",
},
},
{
surfaceId: "aetheria.daemon.editor",
worldInteraction: {
commandBoundary: "aetheria.daemon.editor.commands",
receiptSchema: "aetheria.editor_receipt.v1",
},
},
],
},
});
assert.equal(intent.surfaceId, "aetheria.daemon.editor");
assert.equal(intent.commandBoundary, "aetheria.daemon.editor.commands");
assert.equal(intent.receiptSchema, "aetheria.editor_receipt.v1");
});