Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
test(frontend): mock useUiLanguage in runDetail; answer system-prompt fetches by method
Ruben Lütke622b90cf6bb4
diff --git a/jarvis/ui/web/frontend/src/components/runs/__tests__/runDetail.test.tsx b/jarvis/ui/web/frontend/src/components/runs/__tests__/runDetail.test.tsxindex 0a9020f9c8..12890367c0 100644--- a/jarvis/ui/web/frontend/src/components/runs/__tests__/runDetail.test.tsx+++ b/jarvis/ui/web/frontend/src/components/runs/__tests__/runDetail.test.tsx@@ -23,7 +23,10 @@ vi.mock("@/hooks/useRuns", () => ({},}),}));-vi.mock("@/i18n", () => ({ useT: () => (k: string) => k }));+vi.mock("@/i18n", () => ({+ useT: () => (k: string) => k,+ useUiLanguage: () => "en",+}));import { RunDetail } from "../RunDetail";diff --git a/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsxindex 6da3322372..fb555a7c5c 100644--- a/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx+++ b/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx@@ -39,13 +39,17 @@ describe("SystemPromptGroup", () => {});it("PUTs the edited content when Save is clicked", async () => {- const fetchMock = vi- .fn()- .mockResolvedValueOnce({ ok: true, json: async () => DEFAULT_STATE })- .mockResolvedValueOnce({- ok: true,- json: async () => ({ ...CUSTOM_STATE, ok: true, restart_required: false }),- });+ // Answer by method, not by call order: an extra GET (e.g. a re-mount+ // refetch) must not consume the PUT response and silently un-dirty the+ // draft, which leaves Save disabled and no PUT ever issued.+ const fetchMock = vi.fn(async (_url: string, opts?: RequestInit) =>+ opts?.method === "PUT"+ ? {+ ok: true,+ json: async () => ({ ...CUSTOM_STATE, ok: true, restart_required: false }),+ }+ : { ok: true, json: async () => DEFAULT_STATE },+ );vi.stubGlobal("fetch", fetchMock);render(<SystemPromptGroup />);@@ -54,7 +58,9 @@ describe("SystemPromptGroup", () => {);fireEvent.change(editor, { target: { value: "You are NOVA, a custom assistant." } });- fireEvent.click(screen.getByText("Save prompt"));+ const save = screen.getByText("Save prompt").closest("button")!;+ await waitFor(() => expect(save.hasAttribute("disabled")).toBe(false));+ fireEvent.click(save);await waitFor(() => {const putCall = fetchMock.mock.calls.find(([, opts]) => opts?.method === "PUT");