Skip to content

Commit 90e185a

Browse files
committed
test(mcp): the non-lookup CONTROL key holds a record id
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6f49d6a commit 90e185a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎packages/mcp/src/mcp-http-tools.aggregation-entry.test.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ describe('aggregate_records — a lookup group names its record beside the id, r
392392
parent: { type: 'master_detail', reference: 'account' },
393393
partner: { type: 'lookup', reference: 'sys_partner' },
394394
stage: { type: 'select', options: [{ value: 'won' }, { value: 'lost' }] },
395+
ref_code: { type: 'text' },
395396
amount: { type: 'number' },
396397
},
397398
};
@@ -447,14 +448,14 @@ describe('aggregate_records — a lookup group names its record beside the id, r
447448
expect(aliased.rows).toEqual([{ p: 'a2', p__label: 'Globex', n: 2 }]);
448449
});
449450

450-
it('CONTROL — a second key that is not a lookup carries no label', async () => {
451-
const bridge = lookupBridge([{ account: 'a1', stage: 'won', n: 2 }, { account: 'a2', stage: 'lost', n: 1 }]);
452-
const out = await answer(bridge, { aggregations: COUNT, groupBy: ['account', 'stage'] });
451+
it('CONTROL — a second key that is not a lookup carries no label, even where its value is a record id', async () => {
452+
const bridge = lookupBridge([{ account: 'a1', ref_code: 'a2', n: 2 }, { account: 'a2', ref_code: 'a1', n: 1 }]);
453+
const out = await answer(bridge, { aggregations: COUNT, groupBy: ['account', 'ref_code'] });
453454
expect(out.rows).toEqual([
454-
{ account: 'a1', account__label: 'Acme', stage: 'won', n: 2 },
455-
{ account: 'a2', account__label: 'Globex', stage: 'lost', n: 1 },
455+
{ account: 'a1', account__label: 'Acme', ref_code: 'a2', n: 2 },
456+
{ account: 'a2', account__label: 'Globex', ref_code: 'a1', n: 1 },
456457
]);
457-
for (const row of out.rows) expect(row).not.toHaveProperty('stage__label');
458+
for (const row of out.rows) expect(row).not.toHaveProperty('ref_code__label');
458459
});
459460

460461
it('CONTROL — a record the caller\'s read does not return and a deleted record answer the same, with no label', async () => {

0 commit comments

Comments
 (0)