@@ -359,6 +359,42 @@ describe('Settings', () => {
359
359
expect ( db . _getSettings ( ) . experimentalForceLongPolling ) . to . be . false ;
360
360
} ) ;
361
361
362
+ it ( 'long polling autoDetect=[something truthy] is corced to true' , ( ) => {
363
+ // Use a new instance of Firestore in order to configure settings.
364
+ const db = newTestFirestore ( ) ;
365
+ db . _setSettings ( {
366
+ experimentalAutoDetectLongPolling : 1 as any ,
367
+ } ) ;
368
+ expect ( db . _getSettings ( ) . experimentalAutoDetectLongPolling ) . to . be . true ;
369
+ } ) ;
370
+
371
+ it ( 'long polling autoDetect=[something falsy] is corced to false' , ( ) => {
372
+ // Use a new instance of Firestore in order to configure settings.
373
+ const db = newTestFirestore ( ) ;
374
+ db . _setSettings ( {
375
+ experimentalAutoDetectLongPolling : 0 as any ,
376
+ } ) ;
377
+ expect ( db . _getSettings ( ) . experimentalAutoDetectLongPolling ) . to . be . false ;
378
+ } ) ;
379
+
380
+ it ( 'long polling force=[something truthy] is corced to true' , ( ) => {
381
+ // Use a new instance of Firestore in order to configure settings.
382
+ const db = newTestFirestore ( ) ;
383
+ db . _setSettings ( {
384
+ experimentalForceLongPolling : "I am truthy" as any ,
385
+ } ) ;
386
+ expect ( db . _getSettings ( ) . experimentalForceLongPolling ) . to . be . true ;
387
+ } ) ;
388
+
389
+ it ( 'long polling force=[something falsy] is corced to false' , ( ) => {
390
+ // Use a new instance of Firestore in order to configure settings.
391
+ const db = newTestFirestore ( ) ;
392
+ db . _setSettings ( {
393
+ experimentalForceLongPolling : NaN as any ,
394
+ } ) ;
395
+ expect ( db . _getSettings ( ) . experimentalForceLongPolling ) . to . be . false ;
396
+ } ) ;
397
+
362
398
it ( 'gets settings from useEmulator' , ( ) => {
363
399
// Use a new instance of Firestore in order to configure settings.
364
400
const db = newTestFirestore ( ) ;
0 commit comments