@@ -204,14 +204,23 @@ describe('Change Streams', function () {
204
204
} ) ;
205
205
206
206
context ( 'fullDocument' , ( ) => {
207
- it ( 'sets fullDocument to `undefined` if no value is passed ' , function ( ) {
207
+ it ( 'does not set fullDocument if no value is provided ' , function ( ) {
208
208
const changeStream = client . watch ( ) ;
209
209
210
210
expect ( changeStream ) . not . to . have . nested . property (
211
211
'cursor.pipeline[0].$changeStream.fullDocument'
212
212
) ;
213
213
} ) ;
214
214
215
+ it ( 'does not validate the value passed in for the `fullDocument` property' , function ( ) {
216
+ const changeStream = client . watch ( [ ] , { fullDocument : 'invalid value' } ) ;
217
+
218
+ expect ( changeStream ) . to . have . nested . property (
219
+ 'cursor.pipeline[0].$changeStream.fullDocument' ,
220
+ 'invalid value'
221
+ ) ;
222
+ } ) ;
223
+
215
224
it ( 'assigns `fullDocument` to the correct value if it is passed as an option' , function ( ) {
216
225
const changeStream = client . watch ( [ ] , { fullDocument : 'updateLookup' } ) ;
217
226
@@ -232,15 +241,15 @@ describe('Change Streams', function () {
232
241
) ;
233
242
} ) ;
234
243
235
- it ( 'does not assigns `allChangesForCluster` if the ChangeStream.type is Db' , function ( ) {
244
+ it ( 'does not assign `allChangesForCluster` if the ChangeStream.type is Db' , function ( ) {
236
245
const changeStream = db . watch ( ) ;
237
246
238
247
expect ( changeStream ) . not . to . have . nested . property (
239
248
'cursor.pipeline[0].$changeStream.allChangesForCluster'
240
249
) ;
241
250
} ) ;
242
251
243
- it ( 'does not assign `allChangesForCluster` if the ChangeStream.type is Db ' , function ( ) {
252
+ it ( 'does not assign `allChangesForCluster` if the ChangeStream.type is Collection ' , function ( ) {
244
253
const changeStream = collection . watch ( ) ;
245
254
246
255
expect ( changeStream ) . not . to . have . nested . property (
0 commit comments