Skip to content

Commit aa07b51

Browse files
guillaumeboehmsudo-tee
authored andcommitted
tests(config_file): Add disabled default agents config test
1 parent 6a565df commit aa07b51

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/config_file_spec.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ describe('config_file.setup', function()
6464
assert.True(vim.tbl_contains(agents, 'plan'))
6565
end)
6666

67+
it('get_opencode_agents respects disabled defaults', function()
68+
state.api_client = {
69+
get_config = function()
70+
return Promise.new():resolve({ agent = { ['custom'] = { mode = 'primary' }, ['build'] = { disable = true }, ['plan'] = { disable = false } } })
71+
end,
72+
get_current_project = function()
73+
return Promise.new():resolve({ id = 'p1' })
74+
end,
75+
}
76+
local agents = config_file.get_opencode_agents()
77+
assert.True(vim.tbl_contains(agents, 'custom'))
78+
assert.False(vim.tbl_contains(agents, 'build'))
79+
assert.True(vim.tbl_contains(agents, 'plan'))
80+
end)
81+
6782
it('get_opencode_project returns project', function()
6883
local project = { id = 'p1', name = 'X' }
6984
state.api_client = {

0 commit comments

Comments
 (0)