feat(permissions): expose network permission state (#103)

This commit is contained in:
2026-07-25 23:05:55 +02:00
parent e8731834f4
commit 3047dc9195
31 changed files with 2080 additions and 94 deletions

View File

@ -55,6 +55,22 @@ describe("TerminalView (with MockTerminalGateway)", () => {
expect(screen.getByTestId("terminal-view")).toBeTruthy();
});
it("shows a non-blocking network banner when system permissions are locked", () => {
renderView(new MockTerminalGateway(), "/home/me/proj", {
systemPermissions: {
wanted: "allow",
effective: "deny",
runtimeLock: { state: "locked", reason: "Runtime network locked." },
control: { mode: "readOnly", reason: "Runtime network locked." },
},
});
expect(screen.getByTestId("terminal-network-banner").textContent).toContain(
"Réseau verrouillé par le runtime.",
);
expect(screen.getByTestId("terminal-view")).toBeTruthy();
});
it("opens a terminal through the gateway with the given cwd", async () => {
const gw = new MockTerminalGateway();
const openSpy = vi.spyOn(gw, "openTerminal");