fix: align plan tool test with W11 dependsOn semantics

create_or_update_plan omits `dependsOn` when the caller did not send it
(08a49e2f5, W11), but the spec still expected it normalized to []. Lock
in both cases instead: omitted stays absent, provided is kept and
trimmed. This is the failure blocking PR #148 CI; the spec was stale on
master itself.
This commit is contained in:
John Smith
2026-09-22 17:29:03 -04:00
parent f34e40d4ee
commit f72bb71f60
@@ -37,6 +37,8 @@ describe('server-side handled tools', () => {
],
});
expect(result.success).toBe(true);
// W11: `dependsOn` is only set when the caller sent it, so an omitted
// `dependsOn` stays absent rather than being normalized to `[]`.
expect((result: any).plan).toEqual({
tasks: [
{
@@ -44,7 +46,30 @@ describe('server-side handled tools', () => {
title: 'Write the GDD',
description: 'Sections: overview, economy.',
status: 'pending',
dependsOn: [],
},
],
});
const withDependencies = await launch('create_or_update_plan', {
tasks: [
{
id: 'gdd',
title: 'Write the GDD',
description: 'Sections: overview, economy.',
status: 'pending',
dependsOn: [' research '],
},
],
});
expect(withDependencies.success).toBe(true);
expect((withDependencies: any).plan).toEqual({
tasks: [
{
id: 'gdd',
title: 'Write the GDD',
description: 'Sections: overview, economy.',
status: 'pending',
dependsOn: ['research'],
},
],
});