feat(web): update button in Settings (#15)

Shows the installed commit, checks for new commits, starts the update after
a confirmation and follows its output through the service restart.
This commit is contained in:
Florian Schmidt
2026-11-16 15:31:01 +01:00
parent 936abbef9d
commit 2025185489
6 changed files with 373 additions and 3 deletions
+9
View File
@@ -67,10 +67,19 @@ it("renders system/session/Claude information and opens the terminal", async ()
version: "Claude 1",
loginAppearsPresent: true,
});
vi.spyOn(settingsApi, "updateStatus").mockResolvedValue({
available: true,
state: "idle",
current: "abc1234",
startedAt: null,
finishedAt: null,
log: "",
});
const revoke = vi.spyOn(settingsApi, "revoke").mockResolvedValue();
const open = vi.fn();
render(<SettingsPage openTerminal={open} />);
expect(await screen.findByText("/workspace")).toBeInTheDocument();
expect(await screen.findByRole("button", { name: "Update now" })).toBeInTheDocument();
expect(screen.getByText(/86400 seconds/)).toBeInTheDocument();
expect(screen.getByText("Available: Claude 1")).toBeInTheDocument();
fireEvent.click(screen.getByText("Open terminal to log in"));