| 3 | import { isComposedInitMainFile, isSingleNotebookDeepnoteFile } from './file-shape' |
| 4 | |
| 5 | function makeFile(args: { initNotebookId?: string; notebooks: Array<{ id: string }> }): DeepnoteFile { |
| 6 | return { |
| 7 | version: '1.0.0', |
| 8 | metadata: { createdAt: '2025-01-01T00:00:00Z' }, |
| 9 | project: { |
| 10 | id: 'proj-1', |
| 11 | name: 'Test', |
| 12 | ...(args.initNotebookId !== undefined ? { initNotebookId: args.initNotebookId } : {}), |
| 13 | notebooks: args.notebooks.map(nb => ({ |
| 14 | id: nb.id, |
| 15 | name: nb.id, |
| 16 | blocks: [], |
| 17 | })), |
| 18 | }, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | describe('isSingleNotebookDeepnoteFile', () => { |
| 23 | it('returns true for a single-notebook file', () => { |