File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
packages/server/test/complete Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -138,16 +138,15 @@ describe('TableName completion', () => {
138138 schema
139139 )
140140
141- // Should suggest table names, not columns
142- expect ( result . candidates ) . toEqual (
143- expect . arrayContaining ( [ expect . objectContaining ( { label : 'notes' } ) ] )
144- )
145- // Should NOT include column suggestions
146- expect ( result . candidates ) . not . toEqual (
147- expect . arrayContaining ( [ expect . objectContaining ( { label : 'id' } ) ] )
148- )
149- expect ( result . candidates ) . not . toEqual (
150- expect . arrayContaining ( [ expect . objectContaining ( { label : 'name' } ) ] )
151- )
141+ // Should suggest table names
142+ const labels = result . candidates . map ( ( c ) => c . label )
143+ expect ( labels ) . toContain ( 'notes' )
144+
145+ // Should NOT include any column suggestions (even if qualified)
146+ expect ( labels ) . not . toEqual ( expect . arrayContaining ( [ 'id' , 'name' ] ) )
147+
148+ // All candidates should be tables (CompletionItemKind.Constant = 21)
149+ const TABLE_KIND = 21
150+ expect ( result . candidates . every ( ( c ) => c . kind === TABLE_KIND ) ) . toBe ( true )
152151 } )
153152} )
You can’t perform that action at this time.
0 commit comments