test(dashboard): add fetchProjects to settings test ../../api mocks

SettingsModalNodeRouting and settings-mobile both mock ../../api but
omit fetchProjects, which the SettingsModal now calls during mount.
Add a stub returning an empty list. Drops SettingsModalNodeRouting
failures from 14 → 0 and settings-mobile from 9 → 1 (residual failure
is unrelated and tracked separately).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-19 17:45:36 -07:00
parent cfd20d319a
commit 2a8e6574de
2 changed files with 2 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ vi.mock("../../api", () => ({
testNtfyNotification: vi.fn(),
loginProvider: vi.fn(),
logoutProvider: vi.fn(),
fetchProjects: vi.fn(() => Promise.resolve([])),
}));
vi.mock("../../hooks/useNodes", () => ({

View File

@@ -41,6 +41,7 @@ const defaultSettings = {
} as Settings;
vi.mock("../../api", () => ({
fetchProjects: vi.fn(() => Promise.resolve([])),
fetchSettings: vi.fn(() => Promise.resolve({ ...defaultSettings })),
fetchSettingsByScope: vi.fn(() => Promise.resolve({ global: { ...defaultSettings }, project: {} })),
updateSettings: vi.fn(() => Promise.resolve({ ...defaultSettings })),