Files
social-graph/frontend/src/application/services/graphDataService.test.js
T
gitrusprusandCursor cafc7335ad Add plugin platform with modular backend and frontend registry.
Split graph/import/meta into Django apps, add API v1 with OpenAPI and pytest, and introduce plugin registry with the tags reference plugin on both FE and BE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 09:35:51 +03:00

27 lines
727 B
JavaScript

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')
})
})