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>
27 lines
727 B
JavaScript
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')
|
|
})
|
|
})
|