fix: fix flaky test
This commit is contained in:
parent
7aeb239a6a
commit
9509ae0fee
5 changed files with 38 additions and 33 deletions
|
|
@ -10,7 +10,7 @@ a.describe("window options", function()
|
|||
a.it("Restores window options on close", function()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
oil.close()
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
|
|
@ -18,7 +18,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on edit", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
|
|
@ -26,7 +26,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on split <filename>", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.split({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
|
|
@ -34,7 +34,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on split", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.split()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
|
|
@ -43,7 +43,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on tabnew <filename>", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.tabnew({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
|
|
@ -51,7 +51,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on tabnew", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.tabnew()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
|
|
@ -60,7 +60,7 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Sets the window options when re-entering oil buffer", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd("BufReadPost")
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
assert.truthy(vim.w.oil_did_enter)
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
assert.falsy(vim.w.oil_did_enter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue