@@ -1464,7 +1464,7 @@ suite('Connection Controller Test Suite', function () {
14641464 ) ;
14651465 assert . strictEqual (
14661466 updatedConnection . secretStorageLocation ,
1467- SecretStorageLocation . Keytar
1467+ SecretStorageLocation . KeytarSecondAttempt
14681468 ) ;
14691469 } ) ;
14701470
@@ -1661,6 +1661,16 @@ suite('Connection Controller Test Suite', function () {
16611661 } ,
16621662 'random-connection-2' : {
16631663 id : 'random-connection-2' ,
1664+ name : 'localhost:27017' ,
1665+ storageLocation : 'GLOBAL' ,
1666+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
1667+ connectionOptions : {
1668+ connectionString :
1669+ 'mongodb://localhost:27017/?readPreference=primary&ssl=false' ,
1670+ } ,
1671+ } ,
1672+ 'random-connection-3' : {
1673+ id : 'random-connection-3' ,
16641674 name : 'localhost:27018' ,
16651675 storageLocation : 'GLOBAL' ,
16661676 connectionOptions : {
@@ -1676,7 +1686,7 @@ suite('Connection Controller Test Suite', function () {
16761686 ( connectionInfo ) =>
16771687 Promise . resolve ( {
16781688 ...connectionInfo ,
1679- secretStorageLocation : SecretStorageLocation . Keytar ,
1689+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
16801690 } as any )
16811691 ) ;
16821692 const trackStub = testSandbox . stub (
@@ -1691,16 +1701,16 @@ suite('Connection Controller Test Suite', function () {
16911701 // Notified to user
16921702 assert . strictEqual ( showInformationMessageStub . calledOnce , true ) ;
16931703 assert . deepStrictEqual ( showInformationMessageStub . lastCall . args , [
1694- keytarMigrationFailedMessage ( 1 ) ,
1704+ keytarMigrationFailedMessage ( 2 ) ,
16951705 ] ) ;
16961706
16971707 // Tracked
16981708 assert . strictEqual ( trackStub . calledOnce , true ) ;
16991709 assert . deepStrictEqual ( trackStub . lastCall . args , [
17001710 {
1701- saved_connections : 2 ,
1702- loaded_connections : 2 ,
1703- connections_with_failed_keytar_migration : 1 ,
1711+ saved_connections : 3 ,
1712+ loaded_connections : 3 ,
1713+ connections_with_failed_keytar_migration : 2 ,
17041714 } ,
17051715 ] ) ;
17061716 } ) ;
@@ -1719,7 +1729,7 @@ suite('Connection Controller Test Suite', function () {
17191729 id : 'random-connection-1' ,
17201730 name : 'localhost:27017' ,
17211731 storageLocation : 'GLOBAL' ,
1722- secretStorageLocation : SecretStorageLocation . Keytar ,
1732+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
17231733 connectionOptions : {
17241734 connectionString :
17251735 'mongodb://localhost:27017/?readPreference=primary&ssl=false' ,
@@ -1729,7 +1739,7 @@ suite('Connection Controller Test Suite', function () {
17291739 id : 'random-connection-2' ,
17301740 name : 'localhost:27018' ,
17311741 storageLocation : 'GLOBAL' ,
1732- secretStorageLocation : SecretStorageLocation . Keytar ,
1742+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
17331743 connectionOptions : {
17341744 connectionString :
17351745 'mongodb://localhost:27018/?readPreference=primary&ssl=false' ,
@@ -1743,7 +1753,7 @@ suite('Connection Controller Test Suite', function () {
17431753 ( connectionInfo ) =>
17441754 Promise . resolve ( {
17451755 ...connectionInfo ,
1746- secretStorageLocation : SecretStorageLocation . Keytar ,
1756+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
17471757 } as any )
17481758 ) ;
17491759 const trackStub = testSandbox . stub (
@@ -1802,6 +1812,16 @@ suite('Connection Controller Test Suite', function () {
18021812 'mongodb://localhost:27018/?readPreference=primary&ssl=false' ,
18031813 } ,
18041814 } ,
1815+ 'random-connection-4' : {
1816+ id : 'random-connection-4' ,
1817+ name : 'localhost:27018' ,
1818+ storageLocation : 'GLOBAL' ,
1819+ secretStorageLocation : SecretStorageLocation . KeytarSecondAttempt ,
1820+ connectionOptions : {
1821+ connectionString :
1822+ 'mongodb://localhost:27018/?readPreference=primary&ssl=false' ,
1823+ } ,
1824+ } ,
18051825 } as any ;
18061826 } ) ;
18071827 testSandbox . replace (
@@ -1824,10 +1844,10 @@ suite('Connection Controller Test Suite', function () {
18241844 assert . strictEqual ( trackStub . calledOnce , true ) ;
18251845 assert . deepStrictEqual ( trackStub . lastCall . args , [
18261846 {
1827- connections_with_secrets_in_keytar : 1 ,
1847+ connections_with_secrets_in_keytar : 2 ,
18281848 connections_with_secrets_in_secret_storage : 2 ,
1829- saved_connections : 3 ,
1830- loaded_connections : 3 ,
1849+ saved_connections : 4 ,
1850+ loaded_connections : 4 ,
18311851 } ,
18321852 ] ) ;
18331853 } ) ;
0 commit comments