Skip to content

Commit

Permalink
chore: assertion on neotree
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Sep 3, 2024
1 parent 6d76777 commit ea595ed
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ Helpers.new_child_neovim = function()
error(msg)
end

child.wait = function()
child.loop.sleep(10)
child.wait = function(ms)
child.loop.sleep(ms or 10)
end

child.nnp = function()
Expand Down
49 changes: 49 additions & 0 deletions tests/test_integrations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,55 @@ T["neo-tree"]["keeps sides open"] = function()
id = 1004,
open = "Neotree reveal",
})

child.nnp()
child.nnp()

Helpers.expect.equality(child.get_wins_in_tab(), { 1005, 1004, 1000, 1006 })

Helpers.expect.state(child, "tabs[1].wins.main", {
curr = 1000,
left = 1005,
right = 1006,
})

Helpers.expect.state(child, "tabs[1].wins.columns", 4)

Helpers.expect.state(child, "tabs[1].wins.integrations.NeoTree", {
close = "Neotree close",
fileTypePattern = "neo-tree",
id = 1004,
open = "Neotree reveal",
})
end


T["neo-tree"]["properly enables nnp with tree already opened"] = function()
child.restart({ "-u", "scripts/init_with_neotree.lua", "." })

Helpers.expect.equality(child.get_wins_in_tab(1), { 1002, 1000 })

child.cmd("e Makefile")

child.nnp()

Helpers.expect.equality(child.get_wins_in_tab(), { 1004, 1002, 1000, 1005 })

Helpers.expect.state(child, "enabled", true)

Helpers.expect.state(child, "tabs[1].wins.integrations.NeoTree", {
close = "Neotree close",
fileTypePattern = "neo-tree",
id = 1002,
open = "Neotree reveal",
})


Helpers.expect.state(child, "tabs[1].wins.main", {
curr = 1000,
left = 1004,
right = 1005,
})
end

T["TSPlayground"] = MiniTest.new_set()
Expand Down

0 comments on commit ea595ed

Please sign in to comment.