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:
@@ -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", () => ({
|
||||
|
||||
@@ -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 })),
|
||||
|
||||
Reference in New Issue
Block a user