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:
@ -102,6 +102,33 @@ describe("PermissionsPanel", () => {
|
||||
expect(screen.getAllByText("Réseau autorisé").length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("defaults cross-project contactability off and persists the agent checkbox", async () => {
|
||||
const { permission } = await renderPanel();
|
||||
|
||||
fireEvent.click(screen.getByText("Builder"));
|
||||
|
||||
const checkbox = screen.getByLabelText(
|
||||
"Contactable depuis d’autres projets",
|
||||
) as HTMLInputElement;
|
||||
expect(checkbox.checked).toBe(false);
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Autorise les agents d’autres projets IdeA à solliciter cet agent via l’orchestration inter-projets. L’agent reste soumis à ses permissions et à son contexte.",
|
||||
),
|
||||
).toBeTruthy();
|
||||
|
||||
fireEvent.click(checkbox);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save network" }));
|
||||
|
||||
await waitFor(async () => {
|
||||
const doc = await permission.getProjectSystemPermissions(PROJECT_ID);
|
||||
expect(doc.agents?.[0]).toEqual({
|
||||
agentId: expect.any(String),
|
||||
permissions: { crossProjectContactable: true },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("renders the network control read-only when persisted control says so", async () => {
|
||||
const agent = new MockAgentGateway();
|
||||
const permission = new MockPermissionGateway();
|
||||
|
||||
Reference in New Issue
Block a user