test: update unnamed buffer tests for tmpfile fallback

Problem: the unnamed buffer guard tests expected a "no file name"
warning that no longer exists after the tmpfile fallback change.

Solution: update assertions to expect the downstream messages that
unnamed buffers now reach ("no provider configured", "no output file").
This commit is contained in:
Barrett Ruth 2026-03-13 08:20:48 -04:00
parent c1734eec8f
commit 20f44f44a2
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -126,43 +126,43 @@ describe('preview', function()
return msg
end
it('compile warns on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'typst')
it('compile falls through to provider check on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'lua')
local msg = capture_notify(function()
preview.compile(bufnr)
end)
assert.is_not_nil(msg)
assert.is_truthy(msg:find('no file name'))
assert.is_truthy(msg:find('no provider configured'))
helpers.delete_buffer(bufnr)
end)
it('toggle warns on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'typst')
it('toggle falls through to provider check on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'lua')
local msg = capture_notify(function()
preview.toggle(bufnr)
end)
assert.is_not_nil(msg)
assert.is_truthy(msg:find('no file name'))
assert.is_truthy(msg:find('no provider configured'))
helpers.delete_buffer(bufnr)
end)
it('clean warns on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'typst')
it('clean falls through to provider check on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'lua')
local msg = capture_notify(function()
preview.clean(bufnr)
end)
assert.is_not_nil(msg)
assert.is_truthy(msg:find('no file name'))
assert.is_truthy(msg:find('no provider configured'))
helpers.delete_buffer(bufnr)
end)
it('open warns on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'typst')
it('open warns no output on unnamed buffer', function()
local bufnr = helpers.create_buffer({}, 'lua')
local msg = capture_notify(function()
preview.open(bufnr)
end)
assert.is_not_nil(msg)
assert.is_truthy(msg:find('no file name'))
assert.is_truthy(msg:find('no output file'))
helpers.delete_buffer(bufnr)
end)
end)