Skip to content

Commit 44d22ba

Browse files
committed
test(toggle): fix tests for api.open
1 parent 826341d commit 44d22ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/unit/api_spec.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local core = require('opencode.core')
33
local ui = require('opencode.ui.ui')
44
local state = require('opencode.state')
55
local stub = require('luassert.stub')
6+
local assert = require('luassert')
67

78
describe('opencode.api', function()
89
local created_commands = {}
@@ -87,12 +88,12 @@ describe('opencode.api', function()
8788
-- Test open_input command
8889
stored_fns['OpencodeOpenInput']()
8990
assert.stub(core.open).was_called()
90-
assert.stub(core.open).was_called_with({ new_session = false, focus = 'input' })
91+
assert.stub(core.open).was_called_with({ new_session = false, focus = 'input', start_insert = true })
9192

9293
-- Test open_input_new_session command
9394
stored_fns['OpencodeOpenInputNewSession']()
9495
assert.stub(core.open).was_called()
95-
assert.stub(core.open).was_called_with({ new_session = true, focus = 'input' })
96+
assert.stub(core.open).was_called_with({ new_session = true, focus = 'input', start_insert = true })
9697

9798
-- Test stop command
9899
stored_fns['OpencodeStop']()
@@ -130,7 +131,7 @@ describe('opencode.api', function()
130131
assert.is_function(api.open_input, 'Should export open_input')
131132
api.open_input()
132133
assert.stub(core.open).was_called()
133-
assert.stub(core.open).was_called_with({ new_session = false, focus = 'input' })
134+
assert.stub(core.open).was_called_with({ new_session = false, focus = 'input', start_insert = true })
134135

135136
-- Test run function
136137
assert.is_function(api.run, 'Should export run')

0 commit comments

Comments
 (0)