diff --git a/tools/protocol.test.mjs b/tools/protocol.test.mjs index 15d0329..6ea156c 100644 --- a/tools/protocol.test.mjs +++ b/tools/protocol.test.mjs @@ -97,9 +97,14 @@ test('an unknown type is refused, unknown fields are ignored, and every intent g assert.equal((await gm.ws.request({ t: 'token.teleport', id: 'x' })).code, 'unknown-type') assert.equal((await gm.ws.request({ t: '' })).code, 'unknown-type') assert.equal((await gm.ws.request({ t: 'TOKEN.MOVE', id: 'x' })).code, 'unknown-type') - // a catalogue intent whose slice has not landed still answers exactly once - assert.equal((await gm.ws.request({ t: 'token.create', scene: 1 })).code, 'unknown-type') + // a catalogue intent whose slice has not landed still answers exactly once (slices 6-8) + assert.equal((await gm.ws.request({ t: 'status.set', id: 'x', status: 'stuck' })).code, + 'unknown-type') assert.equal((await gm.ws.request({ t: 'scene.set', scene: 1 })).code, 'unknown-type') + assert.equal((await gm.ws.request({ t: 'character.create', descriptive_name: 'x', + actual_name: 'X' })).code, 'unknown-type') + // an intent whose slice HAS landed answers on its fields (empty token.create = invalid) + assert.equal((await gm.ws.request({ t: 'token.create', scene: 1 })).code, 'invalid') // the reserved FFF hook is refused for everyone and is never ok const act = await gm.ws.request({ t: 'act.do', actor: 1, action: 'x', args: {} }) assert.equal(act.ok, false)