Skip to content

Commit 16382c8

Browse files
authored
fix(tests): add delay to prevent race condition
This adds an arbitrary delay after sending the keys in order to wait for the tree to be fully expanded
1 parent f0bdc84 commit 16382c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/neo-tree/ui/icons_spec.lua

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ describe("ui/icons", function()
6868

6969
vim.api.nvim_win_set_cursor(winid, { 3, 0 })
7070
u.feedkeys("<CR>")
71+
72+
vim.wait(100)
7173

7274
u.assert_buf_lines(bufnr, {
7375
string.format("  %s", fs_tree.abspath):sub(1, 42),
@@ -105,6 +107,8 @@ describe("ui/icons", function()
105107

106108
vim.api.nvim_win_set_cursor(winid, { 3, 0 })
107109
u.feedkeys("<CR>")
110+
111+
vim.wait(100)
108112

109113
u.assert_buf_lines(bufnr, {
110114
vim.fn.strcharpart(string.format("  %s", fs_tree.abspath), 0, 40),
@@ -166,6 +170,8 @@ describe("ui/icons", function()
166170

167171
vim.api.nvim_win_set_cursor(winid, { 3, 0 })
168172
u.feedkeys("<CR>")
173+
174+
vim.wait(100)
169175

170176
u.assert_buf_lines(bufnr, {
171177
string.format(" o %s", fs_tree.abspath):sub(1, 40),
@@ -203,6 +209,8 @@ describe("ui/icons", function()
203209

204210
vim.api.nvim_win_set_cursor(winid, { 3, 0 })
205211
u.feedkeys("<CR>")
212+
213+
vim.wait(100)
206214

207215
u.assert_buf_lines(bufnr, {
208216
vim.fn.strcharpart(string.format(" o %s", fs_tree.abspath), 0, 40),

0 commit comments

Comments
 (0)