@@ -78,6 +78,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
78
78
it ( "should notify that it was disconnected before connecting" , ( ) => {
79
79
expect ( connectionManagerSpies [ "connection-closed" ] ) . toHaveBeenCalled ( ) ;
80
80
} ) ;
81
+
82
+ it ( "should be marked explicitly as disconnected" , ( ) => {
83
+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "disconnected" ) ;
84
+ } ) ;
81
85
} ) ;
82
86
83
87
describe ( "when reconnects" , ( ) => {
@@ -95,6 +99,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
95
99
it ( "should notify that it was connected again" , ( ) => {
96
100
expect ( connectionManagerSpies [ "connection-succeeded" ] ) . toHaveBeenCalled ( ) ;
97
101
} ) ;
102
+
103
+ it ( "should be marked explicitly as connected" , ( ) => {
104
+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "connected" ) ;
105
+ } ) ;
98
106
} ) ;
99
107
100
108
describe ( "when fails to connect to a new cluster" , ( ) => {
@@ -116,6 +124,10 @@ describeWithMongoDB("Connection Manager", (integration) => {
116
124
it ( "should notify that it failed connecting" , ( ) => {
117
125
expect ( connectionManagerSpies [ "connection-errored" ] ) . toHaveBeenCalled ( ) ;
118
126
} ) ;
127
+
128
+ it ( "should be marked explicitly as connected" , ( ) => {
129
+ expect ( connectionManager ( ) . currentConnectionState . tag ) . toEqual ( "errored" ) ;
130
+ } ) ;
119
131
} ) ;
120
132
} ) ;
121
133
0 commit comments