Resolve embedded provider documents generically
This commit is contained in:
parent
8f658932b5
commit
3d324b019f
3 changed files with 16 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ function harness() {
|
|||
const sent = [];
|
||||
const connections = [];
|
||||
const encoded = [];
|
||||
const records = new Map([["records/provider", advertisement], ["records/world", surface], ["records/receipts:cmd-1", ["gamecult.eve.command_receipt.v1", "receipt-1", "cmd-1", "move", "accepted", "Provider", "daemon", "test-provider", "world", "moved", "now", 4]]]);
|
||||
const records = new Map([["records/provider", advertisement], ["records/world", surface], ["records/objects", { entities: [1] }], ["records/receipts:cmd-1", ["gamecult.eve.command_receipt.v1", "receipt-1", "cmd-1", "move", "accepted", "Provider", "daemon", "test-provider", "world", "moved", "now", 4]]]);
|
||||
const peer = { send: message => sent.push(message), close() {}, on() {} };
|
||||
const mesh = {
|
||||
createPeerCatalog: () => ({ upsert() {} }), createAuthorityLeaseCatalog: () => ({ upsert() {} }),
|
||||
|
|
@ -60,6 +60,13 @@ test("submits at the advertised command boundary and reads the advertised receip
|
|||
});
|
||||
});
|
||||
|
||||
test("resolves embedded documents without provider-specific slot logic", async () => {
|
||||
const { client } = harness();
|
||||
assert.deepEqual(await client.resolveDocument({ documentId: "records/objects", schemaId: "test.objects.v1" }), {
|
||||
documentId: "records/objects", schemaId: "test.objects.v1", document: { entities: [1] },
|
||||
});
|
||||
});
|
||||
|
||||
test("refuses unadvertised surfaces", async () => {
|
||||
const { client } = harness();
|
||||
await assert.rejects(() => client.surface("missing"), /does not advertise/);
|
||||
|
|
|
|||
Reference in a new issue