@@ -269,6 +269,29 @@ suite('DeepnoteNotebookManager', () => {
269269 assert . strictEqual ( updatedProject ?. version , mockProject . version ) ;
270270 assert . deepStrictEqual ( updatedProject ?. metadata , mockProject . metadata ) ;
271271 } ) ;
272+
273+ test ( 'should update integrations when currentNotebookId is undefined and return true' , ( ) => {
274+ // Store project with a notebook ID, then clear it to simulate the edge case
275+ manager . storeOriginalProject ( 'project-123' , mockProject , 'notebook-456' ) ;
276+ manager . updateCurrentNotebookId ( 'project-123' , undefined as any ) ;
277+
278+ const integrations = [
279+ { id : 'int-1' , name : 'PostgreSQL' , type : 'pgsql' } ,
280+ { id : 'int-2' , name : 'BigQuery' , type : 'big-query' }
281+ ] ;
282+
283+ const result = manager . updateProjectIntegrations ( 'project-123' , integrations ) ;
284+
285+ assert . strictEqual ( result , true ) ;
286+
287+ const updatedProject = manager . getOriginalProject ( 'project-123' ) ;
288+ assert . deepStrictEqual ( updatedProject ?. project . integrations , integrations ) ;
289+ // Verify other properties remain unchanged
290+ assert . strictEqual ( updatedProject ?. project . id , mockProject . project . id ) ;
291+ assert . strictEqual ( updatedProject ?. project . name , mockProject . project . name ) ;
292+ assert . strictEqual ( updatedProject ?. version , mockProject . version ) ;
293+ assert . deepStrictEqual ( updatedProject ?. metadata , mockProject . metadata ) ;
294+ } ) ;
272295 } ) ;
273296
274297 suite ( 'integration scenarios' , ( ) => {
0 commit comments