@@ -206,7 +206,33 @@ T["client()"]["will not attach to buffer due to filetype exclusion"] = function(
206
206
reference_screenshot (child .get_screenshot (), nil , { ignore_text = { 9 , 10 }, ignore_attr = { 9 , 10 } })
207
207
end
208
208
209
- T [" client()" ][" auto_trigger off - will not attach automatically" ] = function ()
209
+ -- Reenable with new config
210
+ -- T["client()"]["auto_trigger off - will not attach automatically"] = function()
211
+ -- child.configure_copilot()
212
+ -- child.cmd("e test.txt")
213
+ -- child.type_keys("i", "<Esc>")
214
+ -- child.cmd("Copilot status")
215
+ --
216
+ -- local messages = child.lua([[
217
+ -- local messages = ""
218
+ -- local function has_passed()
219
+ -- messages = vim.api.nvim_exec("messages", { output = true }) or ""
220
+ -- if messages:find(".*Online.*attached.*") then
221
+ -- return true
222
+ -- end
223
+ -- end
224
+ --
225
+ -- vim.wait(1000, function()
226
+ -- return has_passed()
227
+ -- end, 50)
228
+ --
229
+ -- return messages
230
+ -- ]])
231
+ --
232
+ -- u.expect_no_match(messages, ".*Online.*attached.*")
233
+ -- end
234
+
235
+ T [" client()" ][" auto_trigger off - will attach automatically" ] = function ()
210
236
child .configure_copilot ()
211
237
child .cmd (" e test.txt" )
212
238
child .type_keys (" i" , " <Esc>" )
@@ -228,12 +254,14 @@ T["client()"]["auto_trigger off - will not attach automatically"] = function()
228
254
return messages
229
255
]] )
230
256
231
- u .expect_no_match (messages , " .*Online.*attached.*" )
257
+ u .expect_match (messages , " .*Online.*attached.*" )
232
258
end
233
259
234
- T [" client()" ][" auto_trigger off - will attach when requesting suggestion" ] = function ()
260
+ T [" client()" ][" suggestion and panel off - will attach automatically" ] = function ()
261
+ child .config .suggestion = " enabled = false,"
235
262
child .configure_copilot ()
236
- child .type_keys (" i" , " <M-l>" , " <Esc>" )
263
+ child .cmd (" e test.txt" )
264
+ child .type_keys (" i" , " <Esc>" )
237
265
child .cmd (" Copilot status" )
238
266
239
267
local messages = child .lua ([[
@@ -245,7 +273,7 @@ T["client()"]["auto_trigger off - will attach when requesting suggestion"] = fun
245
273
end
246
274
end
247
275
248
- vim.wait(5000 , function()
276
+ vim.wait(1000 , function()
249
277
return has_passed()
250
278
end, 50)
251
279
@@ -255,4 +283,29 @@ T["client()"]["auto_trigger off - will attach when requesting suggestion"] = fun
255
283
u .expect_match (messages , " .*Online.*attached.*" )
256
284
end
257
285
286
+ -- re-enable with added configuration
287
+ -- T["client()"]["auto_trigger off - will attach when requesting suggestion"] = function()
288
+ -- child.configure_copilot()
289
+ -- child.type_keys("i", "<M-l>", "<Esc>")
290
+ -- child.cmd("Copilot status")
291
+ --
292
+ -- local messages = child.lua([[
293
+ -- local messages = ""
294
+ -- local function has_passed()
295
+ -- messages = vim.api.nvim_exec("messages", { output = true }) or ""
296
+ -- if messages:find(".*Online.*attached.*") then
297
+ -- return true
298
+ -- end
299
+ -- end
300
+ --
301
+ -- vim.wait(5000, function()
302
+ -- return has_passed()
303
+ -- end, 50)
304
+ --
305
+ -- return messages
306
+ -- ]])
307
+ --
308
+ -- u.expect_match(messages, ".*Online.*attached.*")
309
+ -- end
310
+
258
311
return T
0 commit comments