11local h = require (" tests.helpers" )
22
3- local new_set = MiniTest .new_set
43local T = MiniTest .new_set ()
54
65local child = MiniTest .new_child_neovim ()
@@ -11,6 +10,7 @@ T["UI create_float Screenshots"] = MiniTest.new_set({
1110 h .child_start (child )
1211 child .lua ([[
1312 _G.h = require('tests.helpers')
13+
1414 h.setup_plugin()
1515 ]] )
1616 end ,
@@ -111,59 +111,4 @@ T["UI create_float Screenshots"]["Uses existing buffer without overwriting conte
111111 expect .reference_screenshot (child .get_screenshot ())
112112end
113113
114- T [" UI create_float Screenshots" ][" Uses existing buffer with content overwrite (debug.lua style)" ] = function ()
115- child .lua ([[
116- local ui = require("codecompanion.utils.ui")
117-
118- -- Create an existing buffer (like debug.lua does)
119- local existing_bufnr = vim.api.nvim_create_buf(false, true)
120- vim.api.nvim_buf_set_lines(existing_bufnr, 0, -1, false, {
121- "-- Old debug content",
122- "-- This will be replaced"
123- })
124-
125- -- New debug content to display
126- local new_debug_lines = {
127- "-- Updated Debug Information --",
128- "Chat State: Active",
129- "Messages: 5",
130- "Last Response: 2024-01-15 10:30:00",
131- "",
132- "Adapter Details:",
133- " Name: gpt-4",
134- " Status: Connected",
135- " Tokens Used: 1,234",
136- "",
137- "Recent Activity:",
138- " → User message received",
139- " → Processing with LLM",
140- " → Response generated",
141- " → Display updated"
142- }
143-
144- -- Use create_float with existing buffer (debug.lua pattern)
145- local bufnr, winnr = ui.create_float(new_debug_lines, {
146- bufnr = existing_bufnr,
147- -- overwrite_buffer is not specified, so defaults to true
148- window = { width = 55, height = 16 },
149- row = "center",
150- col = "center",
151- relative = "editor",
152- filetype = "lua",
153- title = "Debug Chat Info",
154- style = "minimal",
155- show_dim = true,
156- })
157-
158- -- Verify new content was set
159- local buffer_content = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
160- assert(buffer_content[1]:match("Updated Debug"), "Should have new debug content")
161- assert(not buffer_content[1]:match("Old debug"), "Should not have old content")
162- assert(bufnr == existing_bufnr, "Should return the same buffer")
163- ]] )
164-
165- local expect = MiniTest .expect
166- expect .reference_screenshot (child .get_screenshot ())
167- end
168-
169114return T
0 commit comments