Skip to content

Commit a952354

Browse files
fix tests
changes the expected value of 'wipe' to 'hide'. Remove check for buffer options as they will be undefined, given that `nvim_buf_set_option` will now have been called.
1 parent ef0592f commit a952354

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/unit/native_terminal_toggle_spec.lua

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ describe("claudecode.terminal.native toggle behavior", function()
283283

284284
-- Verify initial state - buffer should exist and have a window
285285
assert.is_not_nil(mock_state.buffers[initial_bufnr])
286-
assert.are.equal("wipe", mock_state.buffers[initial_bufnr].options.bufhidden)
286+
assert.are.equal("hide", mock_state.buffers[initial_bufnr].options.bufhidden)
287287

288288
-- Find the window that contains our terminal buffer
289289
local terminal_winid = nil
@@ -306,10 +306,7 @@ describe("claudecode.terminal.native toggle behavior", function()
306306
assert.are.equal(initial_bufnr, native_provider.get_active_bufnr())
307307
assert.is_not_nil(mock_state.buffers[initial_bufnr])
308308

309-
-- 2. bufhidden should have been set to "hide" (this is the core fix)
310-
assert.are.equal("hide", mock_state.buffer_options[initial_bufnr].bufhidden)
311-
312-
-- 3. Window should be closed/invalid
309+
-- 2. Window should be closed/invalid
313310
assert.is_nil(mock_state.windows[terminal_winid])
314311
end)
315312

@@ -383,7 +380,6 @@ describe("claudecode.terminal.native toggle behavior", function()
383380
-- Toggle should hide but preserve process
384381
native_provider.toggle(cmd_string, env_table, config)
385382
assert.are.equal(initial_bufnr, native_provider.get_active_bufnr())
386-
assert.are.equal("hide", mock_state.buffer_options[initial_bufnr].bufhidden)
387383

388384
-- Close should kill the process (cleanup_state called)
389385
native_provider.close()
@@ -415,8 +411,7 @@ describe("claudecode.terminal.native toggle behavior", function()
415411
mock_state.current_win = 1 -- Different window
416412
native_provider.simple_toggle(cmd_string, env_table, config)
417413

418-
-- Should have hidden the terminal (set bufhidden=hide and closed window)
419-
assert.are.equal("hide", mock_state.buffer_options[initial_bufnr].bufhidden)
414+
-- Should have hidden the terminal (closed window)
420415
assert.is_nil(mock_state.windows[terminal_winid])
421416
end)
422417

@@ -530,7 +525,6 @@ describe("claudecode.terminal.native toggle behavior", function()
530525
native_provider.focus_toggle(cmd_string, env_table, config)
531526

532527
-- Should have hidden the terminal
533-
assert.are.equal("hide", mock_state.buffer_options[initial_bufnr].bufhidden)
534528
assert.is_nil(mock_state.windows[terminal_winid])
535529
end)
536530
end)

0 commit comments

Comments
 (0)