@@ -151,7 +151,7 @@ suite('MongoDBService Test Suite', () => {
151
151
expect ( completion ) . to . have . property ( 'kind' , CompletionItemKind . Method ) ;
152
152
} ) ;
153
153
154
- test ( 'provide shell collection methods completion if collection name is computed property ' , async ( ) => {
154
+ test ( 'provide shell collection methods completion for a collection name in a bracket notation ' , async ( ) => {
155
155
const result = await testMongoDBService . provideCompletionItems (
156
156
[ 'use("test");' , 'db["test"].' ] . join ( '\n' ) ,
157
157
{ line : 1 , character : 11 }
@@ -163,6 +163,18 @@ suite('MongoDBService Test Suite', () => {
163
163
expect ( completion ) . to . have . property ( 'kind' , CompletionItemKind . Method ) ;
164
164
} ) ;
165
165
166
+ test ( 'provide shell collection methods completion for a collection name in getCollection' , async ( ) => {
167
+ const result = await testMongoDBService . provideCompletionItems (
168
+ [ 'use("test");' , 'db.getCollection("test").' ] . join ( '\n' ) ,
169
+ { line : 1 , character : 41 }
170
+ ) ;
171
+ const completion = result . find (
172
+ ( item : CompletionItem ) => item . label === 'find'
173
+ ) ;
174
+
175
+ expect ( completion ) . to . have . property ( 'kind' , CompletionItemKind . Method ) ;
176
+ } ) ;
177
+
166
178
test ( 'provide shell collection methods completion if single quotes' , async ( ) => {
167
179
const result = await testMongoDBService . provideCompletionItems (
168
180
[ "use('test');" , "db['test']." ] . join ( '\n' ) ,
0 commit comments