test: update priority format assertions from ! to [N]

Problem: fc4a47a changed the priority display format from '! ' to
'[N] ' in views.lua and diff.lua but left two existing test
assertions and their descriptions using the old format, causing
both to fail.

Solution: update the input line in diff parse_buffer test, update
the expected string and description names in views category_view
test, and rename the diff.apply description to match the new idiom.
This commit is contained in:
Barrett Ruth 2026-02-24 22:31:43 -05:00 committed by Barrett Ruth
parent 437944d441
commit cfdffdadfe
2 changed files with 4 additions and 4 deletions

View file

@ -27,7 +27,7 @@ describe('diff', function()
local lines = { local lines = {
'School', 'School',
'/1/ Do homework', '/1/ Do homework',
'/2/ ! Read chapter 5', '/2/ [1] Read chapter 5',
'', '',
'Errands', 'Errands',
'/3/ Buy groceries', '/3/ Buy groceries',
@ -168,7 +168,7 @@ describe('diff', function()
assert.is_nil(task.due) assert.is_nil(task.due)
end) end)
it('clears priority when ! is removed from buffer line', function() it('clears priority when [N] is removed from buffer line', function()
store.add({ description = 'Task name', priority = 1 }) store.add({ description = 'Task name', priority = 1 })
store.save() store.save()
local lines = { local lines = {

View file

@ -116,7 +116,7 @@ describe('views', function()
assert.are.equal('/1/ My task', task_line) assert.are.equal('/1/ My task', task_line)
end) end)
it('formats priority task lines as /ID/ ! description', function() it('formats priority task lines as /ID/ [N] description', function()
store.add({ description = 'Important', category = 'Inbox', priority = 1 }) store.add({ description = 'Important', category = 'Inbox', priority = 1 })
local lines, meta = views.category_view(store.active_tasks()) local lines, meta = views.category_view(store.active_tasks())
local task_line local task_line
@ -125,7 +125,7 @@ describe('views', function()
task_line = lines[i] task_line = lines[i]
end end
end end
assert.are.equal('/1/ ! Important', task_line) assert.are.equal('/1/ [1] Important', task_line)
end) end)
it('sets LineMeta type=header for header lines with correct category', function() it('sets LineMeta type=header for header lines with correct category', function()