@@ -78,6 +78,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
7878 it ( "should notify that it was disconnected before connecting" , ( ) => {
7979 expect ( connectionManagerSpies [ "connection-closed" ] ) . toHaveBeenCalled ( ) ;
8080 } ) ;
81+
82+ it ( "should be marked explicitly as disconnected" , ( ) => {
83+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "disconnected" ) ;
84+ } ) ;
8185 } ) ;
8286
8387 describe ( "when reconnects" , ( ) => {
@@ -95,6 +99,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
9599 it ( "should notify that it was connected again" , ( ) => {
96100 expect ( connectionManagerSpies [ "connection-succeeded" ] ) . toHaveBeenCalled ( ) ;
97101 } ) ;
102+
103+ it ( "should be marked explicitly as connected" , ( ) => {
104+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "connected" ) ;
105+ } ) ;
98106 } ) ;
99107
100108 describe ( "when fails to connect to a new cluster" , ( ) => {
@@ -116,6 +124,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
116124 it ( "should notify that it failed connecting" , ( ) => {
117125 expect ( connectionManagerSpies [ "connection-errored" ] ) . toHaveBeenCalled ( ) ;
118126 } ) ;
127+
128+ it ( "should be marked explicitly as connected" , ( ) => {
129+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "errored" ) ;
130+ } ) ;
119131 } ) ;
120132 } ) ;
121133
0 commit comments