| 4 | |
| 5 | // Helper to create a minimal DeepnoteFile for testing |
| 6 | function createTestFile( |
| 7 | blocks: Array<{ id: string; type: string; content?: string; metadata?: Record<string, unknown> }>, |
| 8 | options?: { notebookName?: string } |
| 9 | ): DeepnoteFile { |
| 10 | return { |
| 11 | version: '1', |
| 12 | project: { |
| 13 | id: 'test-project-id', |
| 14 | name: 'Test Project', |
| 15 | notebooks: [ |
| 16 | { |
| 17 | id: 'test-notebook-id', |
| 18 | name: options?.notebookName ?? 'Test Notebook', |
| 19 | blocks: blocks.map((block, index) => ({ |
| 20 | id: block.id, |
| 21 | type: block.type, |
| 22 | content: block.content ?? '', |
| 23 | metadata: block.metadata ?? {}, |
| 24 | sortingKey: String(index).padStart(5, '0'), |
| 25 | })), |
| 26 | }, |
| 27 | ], |
| 28 | }, |
| 29 | } as DeepnoteFile |
| 30 | } |
| 31 | |
| 32 | describe('analysis utilities', () => { |
| 33 | describe('computeProjectStats', () => { |