diff --git a/packages/testkit/test/oauth.test.ts b/packages/testkit/test/oauth.test.ts index 938844f5..60641496 100644 --- a/packages/testkit/test/oauth.test.ts +++ b/packages/testkit/test/oauth.test.ts @@ -99,7 +99,7 @@ describe("PM tools over MCP", () => { await core.setProjectOwner(db, proj.id, owner.id); const { client, call } = await mcpAs(owner); const tools = (await client.listTools()).tools; - assert.deepEqual(tools.map((t) => t.name).sort(), ["add_member", "answer_question", "create_epic", "create_goal", "create_project", "create_task", "decide_incident", "deploy", "get_incident", "get_incident_policy", "get_task", "list_epics", "list_goals", "list_inbox", "list_incidents", "list_members", "list_projects", "list_releases", "list_tasks", "move_task", "remove_member", "resolve_incident", "set_incident_policy", "set_project_visibility", "update_epic", "update_goal", "update_task"]); + assert.deepEqual(tools.map((t) => t.name).sort(), ["add_member", "answer_question", "create_epic", "create_goal", "create_project", "create_task", "decide_incident", "deploy", "get_incident", "get_incident_policy", "get_project_settings", "get_task", "list_epics", "list_goals", "list_inbox", "list_incidents", "list_members", "list_projects", "list_releases", "list_tasks", "move_task", "remove_member", "resolve_incident", "set_incident_policy", "set_project_visibility", "update_epic", "update_goal", "update_project_settings", "update_task"]); assert.equal(tools.find((t) => t.name === "list_tasks")?.annotations?.readOnlyHint, true); assert.equal(tools.find((t) => t.name === "move_task")?.annotations?.readOnlyHint, false); @@ -124,6 +124,11 @@ describe("PM tools over MCP", () => { assert.ok((await s.call("answer_question", { question_id: q.id, answer: "x" })).isError); assert.match((await call("move_task", { task: `${p.key}-2`, to: "backlog" })).text, /1 session\(s\) stopped/); + // PEP-23: autonomy settings of the project; strangers can't touch them. + assert.match((await call("get_project_settings", { project: p.key })).text, /Уровень: Ручной/); + assert.match((await call("update_project_settings", { project: p.key, level: "auto", proposal: "pm" })).text, /Уровень: Свой[\s\S]*каждый одобряет PM/); + assert.ok((await s.call("update_project_settings", { project: p.key, level: "manual" })).isError); + await call("update_project_settings", { project: p.key, level: "manual" }); }); });