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(settings): wait for the fetched silence window, not just the slider

rubenluetke10-beepfd077483704a
diff --git a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
index bf5cbc5e4c..59181b786f 100644
--- a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
@@ -45,7 +45,11 @@ describe("SilenceWindowGroup", () => {
mockGet(1500);
render(<SilenceWindowGroup />);
const slider = (await screen.findByRole("slider")) as HTMLInputElement;
- expect(slider.value).toBe("1500");
+ // Wait on the VALUE, not just the element. The group renders its slider at
+ // once and adopts the fetched value when the request resolves, so asserting
+ // straight after findByRole is a race the element always wins: it read 0 on
+ // a loaded CI runner while passing every time on a fast machine.
+ await waitFor(() => expect(slider.value).toBe("1500"));
// getByText throws if absent, so reaching the truthy assert means it rendered.
expect(screen.getByText("1.5 s")).toBeTruthy();
});