Skip to content

Commit

Permalink
test: update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
boltlessengineer committed Aug 25, 2024
1 parent 311e7da commit 4d6120e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/client/curl/command_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe(":Rest run", function()
-- run request
vim.cmd(":Rest run")
nio.sleep(100)
---@diagnostic disable-next-line: undefined-field
assert
---@diagnostic disable-next-line: undefined-field
.spy(spy_notify)
.called_with("request failed. See `:Rest logs` for more info", vim.log.levels.ERROR, { title = "rest.nvim" })
end)
Expand Down
5 changes: 4 additions & 1 deletion spec/ui/panes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local panes = {
{
name = "First",
render = function(self)
vim.bo[self.bufnr].filetype = "local"
vim.b[self.bufnr].name = "first"
return true
end,
Expand All @@ -24,6 +25,7 @@ local panes = {

local group = paneui.create_pane_group("test_panes_1", panes, {
on_init = function(self)
vim.bo[self.bufnr].filetype = "global"
utils.nvim_lazy_set_wo(self.bufnr, "winbar", "this-is-a-winbar")
end,
})
Expand All @@ -38,6 +40,7 @@ describe("ui.panes", function()
-- enter the pane
group:enter(0)
assert.same("first", vim.b.name)
assert.same("local", vim.bo.filetype)
assert.same("this-is-a-winbar", vim.api.nvim_get_option_value("winbar", { scope = "local" }))

-- cycle to second pane
Expand All @@ -58,7 +61,7 @@ describe("ui.panes", function()
end)
it("initialize the buffer back after unloaded", function()
-- ensure there is only one window
vim.cmd("wincmd o")
vim.cmd("silent wincmd o")
assert.same(1, vim.api.nvim_get_current_buf())
group:enter(0)
local pane_buf = vim.api.nvim_get_current_buf()
Expand Down

0 comments on commit 4d6120e

Please sign in to comment.