feat(cross-project): surface UI des permissions contactables — PermissionsPanel et TemplateEditor exposent contactable/default_contactable, alignement httpInvoker — #260 (typecheck + 48 tests verts, QA en attente)
This commit is contained in:
@ -173,6 +173,7 @@ describe("TemplatesPanel (with MockTemplateGateway)", () => {
|
||||
target: { value: "profile-main" },
|
||||
});
|
||||
chooseDropdownOption("template system network permission", "Réseau autorisé");
|
||||
fireEvent.click(screen.getByLabelText("Contactable depuis d’autres projets"));
|
||||
fireEvent.click(screen.getByLabelText("template MCP tool idea_ticket_read"));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save template" }));
|
||||
|
||||
@ -186,11 +187,30 @@ describe("TemplatesPanel (with MockTemplateGateway)", () => {
|
||||
expect(templates[0]).toMatchObject({
|
||||
defaultAgentName: "Main",
|
||||
defaultProfileId: "profile-main",
|
||||
systemPermissions: { network: "allow" },
|
||||
systemPermissions: { network: "allow", crossProjectContactable: true },
|
||||
mcpToolPermissions: { allowedTools: ["idea_ticket_read"] },
|
||||
});
|
||||
});
|
||||
|
||||
it("defaults template cross-project contactability off when the field is absent", async () => {
|
||||
renderTemplatesPanel();
|
||||
await waitForTemplatesIdle();
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "create template" }));
|
||||
await waitFor(() => expect(screen.getByLabelText("template name")).toBeTruthy());
|
||||
|
||||
const checkbox = screen.getByLabelText(
|
||||
"Contactable depuis d’autres projets",
|
||||
) as HTMLInputElement;
|
||||
|
||||
expect(checkbox.checked).toBe(false);
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Les agents créés avec ce template reprendront cette permission.",
|
||||
),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
it("the Create button is disabled when the name is empty", async () => {
|
||||
renderTemplatesPanel();
|
||||
await waitForTemplatesIdle();
|
||||
|
||||
Reference in New Issue
Block a user