@@ -158,7 +158,7 @@ suite('SqlCellStatusBarProvider', () => {
158158 assert . strictEqual ( variableItem . priority , 90 ) ;
159159 } ) ;
160160
161- test ( 'shows "Unknown integration (configure)" when config not found' , async ( ) => {
161+ test ( 'shows "Unknown integration (configure)" when config not found and not in project list ' , async ( ) => {
162162 const integrationId = 'postgres-123' ;
163163 const cell = createMockCell (
164164 'sql' ,
@@ -171,6 +171,11 @@ suite('SqlCellStatusBarProvider', () => {
171171 ) ;
172172
173173 when ( integrationStorage . getProjectIntegrationConfig ( anything ( ) , anything ( ) ) ) . thenResolve ( undefined ) ;
174+ when ( notebookManager . getOriginalProject ( 'project-1' ) ) . thenReturn ( {
175+ project : {
176+ integrations : [ ]
177+ }
178+ } as any ) ;
174179
175180 const result = await provider . provideCellStatusBarItems ( cell , cancellationToken ) ;
176181
@@ -188,6 +193,47 @@ suite('SqlCellStatusBarProvider', () => {
188193 assert . strictEqual ( items [ 1 ] . priority , 90 ) ;
189194 } ) ;
190195
196+ test ( 'shows integration name from project list with (configure) suffix when config not found but integration is in project' , async ( ) => {
197+ const integrationId = 'postgres-123' ;
198+ const cell = createMockCell (
199+ 'sql' ,
200+ {
201+ sql_integration_id : integrationId
202+ } ,
203+ {
204+ deepnoteProjectId : 'project-1'
205+ }
206+ ) ;
207+
208+ when ( integrationStorage . getProjectIntegrationConfig ( anything ( ) , anything ( ) ) ) . thenResolve ( undefined ) ;
209+ when ( notebookManager . getOriginalProject ( 'project-1' ) ) . thenReturn ( {
210+ project : {
211+ integrations : [
212+ {
213+ id : integrationId ,
214+ name : 'Production Database' ,
215+ type : 'pgsql'
216+ }
217+ ]
218+ }
219+ } as any ) ;
220+
221+ const result = await provider . provideCellStatusBarItems ( cell , cancellationToken ) ;
222+
223+ assert . isDefined ( result ) ;
224+ assert . isArray ( result ) ;
225+ const items = result as any [ ] ;
226+ assert . strictEqual ( items . length , 2 ) ;
227+ assert . strictEqual ( items [ 0 ] . text , '$(database) Production Database (configure)' ) ;
228+ assert . strictEqual ( items [ 0 ] . alignment , 1 ) ;
229+ assert . strictEqual ( items [ 0 ] . command . command , 'deepnote.switchSqlIntegration' ) ;
230+ assert . deepStrictEqual ( items [ 0 ] . command . arguments , [ cell ] ) ;
231+ assert . strictEqual ( items [ 1 ] . text , 'Variable: df' ) ;
232+ assert . strictEqual ( items [ 1 ] . alignment , 1 ) ;
233+ assert . strictEqual ( items [ 1 ] . command . command , 'deepnote.updateSqlVariableName' ) ;
234+ assert . strictEqual ( items [ 1 ] . priority , 90 ) ;
235+ } ) ;
236+
191237 test ( 'returns only variable item when notebook has no project ID' , async ( ) => {
192238 const integrationId = 'postgres-123' ;
193239 const cell = createMockCell ( 'sql' , {
0 commit comments