| 10 | vi.mock('./container-source', () => ({ loadContainerInventory: vi.fn(), loadContainerTopology: vi.fn() })); |
| 11 | let container: HTMLDivElement, root: Root; |
| 12 | const sample = (): ContainerReading => ({ projects: [], warnings: [], filesRead: 3, topology: { |
| 13 | services: ['web', 'db', 'isolated'].map(id => ({ id, name: id, project: 'p', manifest: 'compose.yml', line: id === 'web' ? 2 : 5, |
| 14 | sourcePaths: [], networks: ['p:default'], ports: [], image: 'fixture:1' })), |
| 15 | connections: [{ id: 'call', source: 'web', target: 'db', kind: 'call', protocol: 'postgres', evidence: [{ project: 'p', path: 'api.ts', line: 7, summary: 'Connects to db' }] }, |
| 16 | { id: 'startup', source: 'web', target: 'db', kind: 'startup', protocol: 'depends_on', evidence: [{ project: 'p', path: 'compose.yml', line: 4, summary: 'Depends on db' }] }], |
| 17 | warnings: [], unresolved: [], |
| 18 | } }); |
| 19 | beforeEach(() => { |
| 20 | (globalThis as unknown as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true; |
| 21 | container = document.createElement('div'); document.body.appendChild(container); root = createRoot(container); |