Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

test(desktop): de-flake UpdatesSettingsTab preference-load test (#5460)

Multica Eve3cde13768bba
diff --git a/apps/desktop/src/renderer/src/components/updates-settings-tab.test.tsx b/apps/desktop/src/renderer/src/components/updates-settings-tab.test.tsx
index 630f72026c..9bee2f4c27 100644
--- a/apps/desktop/src/renderer/src/components/updates-settings-tab.test.tsx
+++ b/apps/desktop/src/renderer/src/components/updates-settings-tab.test.tsx
@@ -85,8 +85,11 @@ describe("UpdatesSettingsTab", () => {
const toggle = screen.getByRole("switch", {
name: "Automatic background updates",
});
- await waitFor(() => expect(toggle).toBeEnabled());
- expect(toggle).not.toBeChecked();
+ // The switch renders as <span role="switch">, so jest-dom's toBeEnabled()
+ // treats it as always enabled and does not actually wait for getPreferences
+ // to resolve. Wait on the persisted value being reflected instead, which
+ // deterministically holds until the loaded preference (false) is applied.
+ await waitFor(() => expect(toggle).not.toBeChecked());
fireEvent.click(toggle);