| 79 | |
| 80 | describe('splitDeepnoteFile', () => { |
| 81 | const createFileWithOutputs = (): DeepnoteFile => ({ |
| 82 | version: '1.0.0', |
| 83 | metadata: { createdAt: '2025-01-01T00:00:00Z' }, |
| 84 | environment: { hash: 'env-123' }, |
| 85 | execution: { startedAt: '2025-01-01T00:00:00Z', finishedAt: '2025-01-01T00:01:00Z' }, |
| 86 | project: { |
| 87 | id: 'proj-123', |
| 88 | name: 'Test Project', |
| 89 | notebooks: [ |
| 90 | { |
| 91 | id: 'nb-1', |
| 92 | name: 'Notebook', |
| 93 | blocks: [ |
| 94 | { |
| 95 | id: 'block-1', |
| 96 | type: 'code', |
| 97 | blockGroup: 'bg-1', |
| 98 | sortingKey: '0000', |
| 99 | content: 'print("hello")', |
| 100 | executionCount: 1, |
| 101 | executionStartedAt: '2025-01-01T00:00:00Z', |
| 102 | executionFinishedAt: '2025-01-01T00:00:01Z', |
| 103 | outputs: [{ output_type: 'stream', name: 'stdout', text: ['hello\n'] }], |
| 104 | metadata: {}, |
| 105 | }, |
| 106 | { |
| 107 | id: 'block-2', |
| 108 | type: 'markdown', |
| 109 | blockGroup: 'bg-2', |
| 110 | sortingKey: '0001', |
| 111 | content: '# Hello', |
| 112 | metadata: {}, |
| 113 | }, |
| 114 | ], |
| 115 | }, |
| 116 | ], |
| 117 | }, |
| 118 | }) |
| 119 | |
| 120 | it('should split file into source and snapshot', () => { |
| 121 | const file = createFileWithOutputs() |