harpoon/lua/harpoon2/test/ui_spec.lua
mpaulson 6fdff8bc41 feat: listeners for list actions
one thing to consider is if we want to add filtering to the listeners by
list?  or should we move the listeners to the list?
2023-11-28 20:34:00 -07:00

29 lines
732 B
Lua

local utils = require("harpoon2.test.utils")
local eq = assert.are.same
describe("harpoon", function()
before_each(utils.before_each(os.tmpname()))
it("open the ui without any items in the list", function()
local harpoon = require("harpoon2")
harpoon.ui:toggle_quick_menu(harpoon:list())
local bufnr = harpoon.ui.bufnr
local win_id = harpoon.ui.win_id
eq(vim.api.nvim_buf_is_valid(bufnr), true)
eq(vim.api.nvim_win_is_valid(win_id), true)
harpoon.ui:toggle_quick_menu()
eq(vim.api.nvim_buf_is_valid(bufnr), false)
eq(vim.api.nvim_win_is_valid(win_id), false)
eq(harpoon.ui.bufnr, nil)
eq(harpoon.ui.win_id, nil)
end)
end)