Skip to content

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.

test(frontend): re-issue the system-prompt edit until the dirty state sticks

Ruben Lütkef54f4a10448a
diff --git a/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx
index fb555a7c5c..e4336058c7 100644
--- a/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/SystemPromptGroup.test.tsx
@@ -56,10 +56,17 @@ describe("SystemPromptGroup", () => {
const editor = await waitFor(
() => screen.getByTestId("system-prompt-editor") as HTMLTextAreaElement,
);
- fireEvent.change(editor, { target: { value: "You are NOVA, a custom assistant." } });
-
const save = screen.getByText("Save prompt").closest("button")!;
- await waitFor(() => expect(save.hasAttribute("disabled")).toBe(false));
+ // A late-resolving initial GET re-syncs the draft from the server value
+ // and un-dirties the editor after a single change event (timing-dependent
+ // — reproduces on slow CI runners). Re-issue the edit inside waitFor
+ // until the dirty state sticks and the button is enabled.
+ await waitFor(() => {
+ fireEvent.change(editor, {
+ target: { value: "You are NOVA, a custom assistant." },
+ });
+ expect(save.hasAttribute("disabled")).toBe(false);
+ });
fireEvent.click(save);
await waitFor(() => {