test: refactor tests to use new helper methods

This commit is contained in:
Steven Arcangeli 2025-01-24 15:41:27 -08:00
parent 57528bf9c5
commit 2f6ed70161
5 changed files with 22 additions and 33 deletions

View file

@ -18,8 +18,7 @@ a.describe("oil preview", function()
a.it("opens preview window", function()
tmpdir:create({ "a.txt" })
oil.open(tmpdir.path)
test_util.wait_oil_ready()
test_util.oil_open(tmpdir.path)
a.wrap(oil.open_preview, 2)()
local preview_win = util.get_preview_win()
assert.not_nil(preview_win)
@ -31,7 +30,7 @@ a.describe("oil preview", function()
a.it("opens preview window when open(preview={})", function()
tmpdir:create({ "a.txt" })
a.wrap(oil.open, 3)(tmpdir.path, { preview = {} })
test_util.oil_open(tmpdir.path, { preview = {} })
local preview_win = util.get_preview_win()
assert.not_nil(preview_win)
assert(preview_win)