Skip to content

Commit 5885d42

Browse files
committed
add a test
1 parent 8c69d03 commit 5885d42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/plenary/ui/mappings/todo_spec.lua

+22
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,26 @@ describe('Todo mappings', function()
408408
' :END:',
409409
}, vim.api.nvim_buf_get_lines(0, 2, 11, false))
410410
end)
411+
412+
it('should update headline cookies when children todo state changes', function()
413+
helpers.create_file({
414+
'* Test orgmode [/]',
415+
'** TODO item',
416+
'** TODO item',
417+
'** TODO item',
418+
'** TODO item',
419+
})
420+
vim.fn.cursor(4, 1)
421+
local now = Date.now()
422+
-- Changing to DONE and adding closed date
423+
vim.cmd([[norm citd]])
424+
assert.are.same({
425+
'* Test orgmode [1/4]',
426+
'** TODO item',
427+
'** TODO item',
428+
'** DONE item',
429+
' CLOSED: [' .. now:to_string() .. ']',
430+
'** TODO item',
431+
}, vim.api.nvim_buf_get_lines(0, 0, 6, false))
432+
end)
411433
end)

0 commit comments

Comments
 (0)