import { describe, it, expect, vi } from 'vitest' vi.mock('../../infrastructure/config/dataMode', () => ({ isLocalMode: () => true, })) vi.mock('../../core/pluginRegistry', () => ({ applyGraphExtensions: (_kind, payload) => payload, })) vi.mock('../usecases/graph', () => ({ getGraphBundle: vi.fn(async () => ({ nodes: [{ id: '1', label: 'A' }], edges: [], relationTypes: [], })), })) describe('graphDataService', () => { it('fetchGraphBundle returns nodes from local use case', async () => { const { fetchGraphBundle } = await import('./graphDataService.js') const bundle = await fetchGraphBundle() expect(bundle.nodes).toHaveLength(1) expect(bundle.nodes[0].label).toBe('A') }) })