@@ -351,7 +351,8 @@ describe('Connection string', function () {
351351 } ) ;
352352
353353 it ( 'can connect to an Atlas cluster with a direct connection' , async function ( ) {
354- if ( ! hasAtlasEnvironmentVariables ( ) ) {
354+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
355+ // Skip this on web because it doesn't support saslprep.
355356 return this . skip ( ) ;
356357 }
357358
@@ -370,19 +371,18 @@ describe('Connection string', function () {
370371 const connectionString = parsedString . toString ( ) ;
371372 await browser . connectWithConnectionString ( connectionString ) ;
372373
373- if ( ! TEST_COMPASS_WEB ) {
374- const result = await browser . shellEval (
375- connectionNameFromString ( connectionString ) ,
376- 'db.runCommand({ connectionStatus: 1 })' ,
377- true
378- ) ;
379- assertNotError ( result ) ;
380- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
381- }
374+ const result = await browser . shellEval (
375+ connectionNameFromString ( connectionString ) ,
376+ 'db.runCommand({ connectionStatus: 1 })' ,
377+ true
378+ ) ;
379+ assertNotError ( result ) ;
380+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
382381 } ) ;
383382
384383 it ( 'can connect to Atlas Serverless' , async function ( ) {
385- if ( ! hasAtlasEnvironmentVariables ( ) ) {
384+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
385+ // Skip this on web because it doesn't support saslprep.
386386 return this . skip ( ) ;
387387 }
388388
@@ -394,19 +394,18 @@ describe('Connection string', function () {
394394
395395 await browser . connectWithConnectionString ( connectionString ) ;
396396
397- if ( ! TEST_COMPASS_WEB ) {
398- const result = await browser . shellEval (
399- connectionName ,
400- 'db.runCommand({ connectionStatus: 1 })' ,
401- true
402- ) ;
403- assertNotError ( result ) ;
404- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
405- }
397+ const result = await browser . shellEval (
398+ connectionName ,
399+ 'db.runCommand({ connectionStatus: 1 })' ,
400+ true
401+ ) ;
402+ assertNotError ( result ) ;
403+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
406404 } ) ;
407405
408406 it ( 'can connect to Atlas Datalake' , async function ( ) {
409- if ( ! hasAtlasEnvironmentVariables ( ) ) {
407+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
408+ // Skip this on web because it doesn't support saslprep.
410409 return this . skip ( ) ;
411410 }
412411
@@ -418,19 +417,18 @@ describe('Connection string', function () {
418417
419418 await browser . connectWithConnectionString ( connectionString ) ;
420419
421- if ( ! TEST_COMPASS_WEB ) {
422- const result = await browser . shellEval (
423- connectionName ,
424- 'db.runCommand({ connectionStatus: 1 })' ,
425- true
426- ) ;
427- assertNotError ( result ) ;
428- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
429- }
420+ const result = await browser . shellEval (
421+ connectionName ,
422+ 'db.runCommand({ connectionStatus: 1 })' ,
423+ true
424+ ) ;
425+ assertNotError ( result ) ;
426+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
430427 } ) ;
431428
432429 it ( 'can connect to Atlas Analytics Node' , async function ( ) {
433- if ( ! hasAtlasEnvironmentVariables ( ) ) {
430+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
431+ // Skip this on web because it doesn't support saslprep.
434432 return this . skip ( ) ;
435433 }
436434
@@ -442,19 +440,18 @@ describe('Connection string', function () {
442440
443441 await browser . connectWithConnectionString ( connectionString ) ;
444442
445- if ( ! TEST_COMPASS_WEB ) {
446- const result = await browser . shellEval (
447- connectionName ,
448- 'db.runCommand({ connectionStatus: 1 })' ,
449- true
450- ) ;
451- assertNotError ( result ) ;
452- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
453- }
443+ const result = await browser . shellEval (
444+ connectionName ,
445+ 'db.runCommand({ connectionStatus: 1 })' ,
446+ true
447+ ) ;
448+ assertNotError ( result ) ;
449+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
454450 } ) ;
455451
456452 it ( 'can connect to Atlas Free Tier' , async function ( ) {
457- if ( ! hasAtlasEnvironmentVariables ( ) ) {
453+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
454+ // Skip this on web because it doesn't support saslprep.
458455 return this . skip ( ) ;
459456 }
460457
@@ -465,19 +462,18 @@ describe('Connection string', function () {
465462 const connectionName = connectionNameFromString ( connectionString ) ;
466463
467464 await browser . connectWithConnectionString ( connectionString ) ;
468- if ( ! TEST_COMPASS_WEB ) {
469- const result = await browser . shellEval (
470- connectionName ,
471- 'db.runCommand({ connectionStatus: 1 })' ,
472- true
473- ) ;
474- assertNotError ( result ) ;
475- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
476- }
465+ const result = await browser . shellEval (
466+ connectionName ,
467+ 'db.runCommand({ connectionStatus: 1 })' ,
468+ true
469+ ) ;
470+ assertNotError ( result ) ;
471+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
477472 } ) ;
478473
479474 it ( 'can connect with readWriteAnyDatabase builtin role' , async function ( ) {
480- if ( ! hasAtlasEnvironmentVariables ( ) ) {
475+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
476+ // Skip this on web because it doesn't support saslprep.
481477 return this . skip ( ) ;
482478 }
483479
@@ -487,15 +483,13 @@ describe('Connection string', function () {
487483
488484 await browser . connectWithConnectionString ( connectionString ) ;
489485
490- if ( ! TEST_COMPASS_WEB ) {
491- const result = await browser . shellEval (
492- connectionName ,
493- 'db.runCommand({ connectionStatus: 1 })' ,
494- true
495- ) ;
496- assertNotError ( result ) ;
497- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
498- }
486+ const result = await browser . shellEval (
487+ connectionName ,
488+ 'db.runCommand({ connectionStatus: 1 })' ,
489+ true
490+ ) ;
491+ assertNotError ( result ) ;
492+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
499493
500494 await assertCanReadData (
501495 browser ,
@@ -506,7 +500,8 @@ describe('Connection string', function () {
506500 } ) ;
507501
508502 it ( 'can connect with readAnyDatabase builtin role' , async function ( ) {
509- if ( ! hasAtlasEnvironmentVariables ( ) ) {
503+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
504+ // Skip this on web because it doesn't support saslprep.
510505 return this . skip ( ) ;
511506 }
512507
@@ -517,15 +512,13 @@ describe('Connection string', function () {
517512
518513 const connectionName = connectionNameFromString ( connectionString ) ;
519514
520- if ( ! TEST_COMPASS_WEB ) {
521- const result = await browser . shellEval (
522- connectionName ,
523- 'db.runCommand({ connectionStatus: 1 })' ,
524- true
525- ) ;
526- assertNotError ( result ) ;
527- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
528- }
515+ const result = await browser . shellEval (
516+ connectionName ,
517+ 'db.runCommand({ connectionStatus: 1 })' ,
518+ true
519+ ) ;
520+ assertNotError ( result ) ;
521+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
529522
530523 await assertCanReadData (
531524 browser ,
@@ -554,7 +547,8 @@ describe('Connection string', function () {
554547 } ) ;
555548
556549 it ( 'can connect with custom role' , async function ( ) {
557- if ( ! hasAtlasEnvironmentVariables ( ) ) {
550+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
551+ // Skip this on web because it doesn't support saslprep.
558552 return this . skip ( ) ;
559553 }
560554
@@ -565,15 +559,13 @@ describe('Connection string', function () {
565559
566560 const connectionName = connectionNameFromString ( connectionString ) ;
567561
568- if ( ! TEST_COMPASS_WEB ) {
569- const result = await browser . shellEval (
570- connectionName ,
571- 'db.runCommand({ connectionStatus: 1 })' ,
572- true
573- ) ;
574- assertNotError ( result ) ;
575- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
576- }
562+ const result = await browser . shellEval (
563+ connectionName ,
564+ 'db.runCommand({ connectionStatus: 1 })' ,
565+ true
566+ ) ;
567+ assertNotError ( result ) ;
568+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
577569
578570 await assertCanReadData ( browser , connectionName , 'test' , 'users' ) ;
579571 await assertCannotCreateDb (
@@ -591,7 +583,7 @@ describe('Connection string', function () {
591583 } ) ;
592584
593585 it ( 'can connect with read one collection specific permission' , async function ( ) {
594- if ( ! hasAtlasEnvironmentVariables ( ) ) {
586+ if ( ! hasAtlasEnvironmentVariables ( ) || TEST_COMPASS_WEB ) {
595587 return this . skip ( ) ;
596588 }
597589
@@ -602,15 +594,13 @@ describe('Connection string', function () {
602594
603595 const connectionName = connectionNameFromString ( connectionString ) ;
604596
605- if ( ! TEST_COMPASS_WEB ) {
606- const result = await browser . shellEval (
607- connectionName ,
608- 'db.runCommand({ connectionStatus: 1 })' ,
609- true
610- ) ;
611- assertNotError ( result ) ;
612- expect ( result ) . to . have . property ( 'ok' , 1 ) ;
613- }
597+ const result = await browser . shellEval (
598+ connectionName ,
599+ 'db.runCommand({ connectionStatus: 1 })' ,
600+ true
601+ ) ;
602+ assertNotError ( result ) ;
603+ expect ( result ) . to . have . property ( 'ok' , 1 ) ;
614604
615605 await assertCanReadData ( browser , connectionName , 'test' , 'users' ) ;
616606 await assertCannotInsertData ( browser , connectionName , 'test' , 'users' ) ;
0 commit comments