mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
test(desktop): de-flake UpdatesSettingsTab preference-load test (#5460)
Co-authored-by: Eve <eve@multica-ai.local> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user