@@ -47,7 +47,6 @@ describe('MongoDB Assistant', function () {
47
47
// Start a mock Assistant server for AI chat responses
48
48
mockAssistantServer = await startMockAssistantServer ( ) ;
49
49
50
- // Set env vars: one for feature flag checks, one for assistant API
51
50
process . env . COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE =
52
51
mockAtlasServer . endpoint ;
53
52
process . env . COMPASS_ASSISTANT_BASE_URL_OVERRIDE =
@@ -119,7 +118,6 @@ describe('MongoDB Assistant', function () {
119
118
it ( 'shows the assistant drawer button when AI features are enabled' , async function ( ) {
120
119
await setAIFeatures ( browser , true ) ;
121
120
122
- // AI Features are enabled by default so the drawer button should be visible.
123
121
const drawerButton = browser . $ ( Selectors . AssistantDrawerButton ) ;
124
122
await drawerButton . waitForDisplayed ( ) ;
125
123
expect ( await drawerButton . isDisplayed ( ) ) . to . be . true ;
@@ -128,7 +126,6 @@ describe('MongoDB Assistant', function () {
128
126
it ( 'does not show the assistant drawer button when AI features are disabled' , async function ( ) {
129
127
await setAIFeatures ( browser , false ) ;
130
128
131
- // Assistant drawer button should not be visible
132
129
const drawerButton = browser . $ ( Selectors . AssistantDrawerButton ) ;
133
130
await drawerButton . waitForDisplayed ( { reverse : true } ) ;
134
131
expect ( await drawerButton . isDisplayed ( ) ) . to . be . false ;
@@ -163,22 +160,17 @@ describe('MongoDB Assistant', function () {
163
160
164
161
await sendMessage ( testMessage ) ;
165
162
166
- // Wait for opt-in modal and decline it
167
163
const declineLink = browser . $ ( Selectors . AIOptInModalDeclineLink ) ;
168
164
await declineLink . waitForDisplayed ( ) ;
169
165
await declineLink . click ( ) ;
170
166
171
- // Wait for the modal to close
172
167
const optInModal = browser . $ ( Selectors . AIOptInModal ) ;
173
168
await optInModal . waitForDisplayed ( { reverse : true } ) ;
174
169
175
- // Verify the input was not cleared after sending
176
170
const chatInput = browser . $ ( Selectors . AssistantChatInputTextArea ) ;
177
171
expect ( await chatInput . getValue ( ) ) . not . to . equal ( testMessage ) ;
178
172
179
- // Verify the message is not displayed in the chat
180
- const chatMessages = browser . $ ( Selectors . AssistantChatMessages ) ;
181
- expect ( await chatMessages . getText ( ) ) . to . not . include ( testMessage ) ;
173
+ expect ( await getDisplayedMessages ( browser ) ) . to . deep . equal ( [ ] ) ;
182
174
183
175
expect ( mockAssistantServer . getRequests ( ) ) . to . be . empty ;
184
176
} ) ;
@@ -205,8 +197,6 @@ describe('MongoDB Assistant', function () {
205
197
206
198
await optInModal . waitForDisplayed ( { reverse : true } ) ;
207
199
208
- expect ( await optInModal . isDisplayed ( ) ) . to . be . false ;
209
-
210
200
expect ( await getDisplayedMessages ( browser ) ) . to . deep . equal ( [ ] ) ;
211
201
} ) ;
212
202
@@ -223,8 +213,6 @@ describe('MongoDB Assistant', function () {
223
213
224
214
await optInModal . waitForDisplayed ( { reverse : true } ) ;
225
215
226
- expect ( await optInModal . isDisplayed ( ) ) . to . be . false ;
227
-
228
216
expect ( await getDisplayedMessages ( browser ) ) . to . deep . equal ( [ ] ) ;
229
217
} ) ;
230
218
} ) ;
0 commit comments