feat(infrastructure,backend,app-tauri,frontend): tools MCP workspace natifs read-only idea_workspace_map/list/read/search, activés par défaut et configurables dans les permissions MCP et les templates — #341 (QA verte)
This commit is contained in:
@ -120,6 +120,28 @@ describe("McpPanel", () => {
|
||||
})).toBeTruthy();
|
||||
});
|
||||
|
||||
it("surfaces native workspace tools as the Outils du projet group", async () => {
|
||||
await renderPanel();
|
||||
await openMcpToolsTab();
|
||||
|
||||
expect(screen.getByRole("button", { name: /Outils du projet, 4 sur 4 autorisés/ })).toBeTruthy();
|
||||
expect(
|
||||
screen.getByText("Permet à l’agent d’explorer, rechercher et lire les fichiers du projet."),
|
||||
).toBeTruthy();
|
||||
expect(screen.getByRole("checkbox", {
|
||||
name: /Cartographier le projet, idea_workspace_map$/,
|
||||
})).toBeTruthy();
|
||||
expect(screen.getByRole("checkbox", {
|
||||
name: /Lister les éléments du projet, idea_workspace_list$/,
|
||||
})).toBeTruthy();
|
||||
expect(screen.getByRole("checkbox", {
|
||||
name: /Lire un élément du projet, idea_workspace_read$/,
|
||||
})).toBeTruthy();
|
||||
expect(screen.getByRole("checkbox", {
|
||||
name: /Rechercher dans le projet, idea_workspace_search$/,
|
||||
})).toBeTruthy();
|
||||
});
|
||||
|
||||
it("shows cross-project tools in their UX group and catalogued unmapped tools in Autres", async () => {
|
||||
const agent = new MockAgentGateway();
|
||||
const permission = new MockPermissionGateway();
|
||||
@ -190,14 +212,14 @@ describe("McpPanel", () => {
|
||||
await selectAgentTarget("DevFrontend");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Créer un override" }));
|
||||
|
||||
expect(screen.getByText(/16 lectures autorisées · 0 écritures autorisées/)).toBeTruthy();
|
||||
expect(screen.getByText(/20 lectures autorisées · 0 écritures autorisées/)).toBeTruthy();
|
||||
|
||||
const writeCheckbox = screen.getByRole("checkbox", {
|
||||
name: /idea_ticket_update_carnet$/,
|
||||
});
|
||||
fireEvent.click(writeCheckbox);
|
||||
|
||||
expect(screen.getByText(/16 lectures autorisées · 1 écriture autorisée/)).toBeTruthy();
|
||||
expect(screen.getByText(/20 lectures autorisées · 1 écriture autorisée/)).toBeTruthy();
|
||||
expect(screen.getByText("Modifications non enregistrées")).toBeTruthy();
|
||||
expect(screen.getByText("Ajouté")).toBeTruthy();
|
||||
});
|
||||
@ -230,7 +252,7 @@ describe("McpPanel", () => {
|
||||
"idea_ticket_update_carnet",
|
||||
]),
|
||||
);
|
||||
expect(calledPolicy?.allowedTools).toHaveLength(17);
|
||||
expect(calledPolicy?.allowedTools).toHaveLength(21);
|
||||
|
||||
// Persisted: the left-column badge flips to Override, and Réinitialiser appears.
|
||||
const nav = screen.getByRole("navigation", { name: "cibles des permissions MCP" });
|
||||
|
||||
Reference in New Issue
Block a user