Skip to content

Commit

Permalink
Bump wait for api node to be 300 millis
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsenkbeil committed Apr 22, 2024
1 parent c19f540 commit 68e3d53
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/api_node_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ describe("org-roam.api.node", function()
roam.api.capture_node({}, function(_id) id = _id end)

-- Wait a bit for the capture buffer to appear
vim.wait(100)
utils.wait()

-- Save the capture buffer and exit it
vim.cmd("wq")

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid capture
assert.is_not_nil(id)
Expand Down Expand Up @@ -97,7 +97,7 @@ describe("org-roam.api.node", function()
end)

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid capture
assert.is_not_nil(id)
Expand Down Expand Up @@ -143,7 +143,7 @@ describe("org-roam.api.node", function()
roam.api.insert_node({}, function(_id) id = _id end)

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid insertion
assert.are.equal("1", id)
Expand Down Expand Up @@ -186,13 +186,13 @@ describe("org-roam.api.node", function()
roam.api.insert_node({}, function(_id) id = _id end)

-- Wait a bit for the capture buffer to appear
vim.wait(100)
utils.wait()

-- Save the capture buffer and exit it
vim.cmd("wq")

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid insertion
assert.is_not_nil(id)
Expand Down Expand Up @@ -231,7 +231,7 @@ describe("org-roam.api.node", function()
roam.api.insert_node({ immediate = true }, function(_id) id = _id end)

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid insertion
assert.is_not_nil(id)
Expand Down Expand Up @@ -269,7 +269,7 @@ describe("org-roam.api.node", function()
roam.api.find_node({}, function(_id) id = _id end)

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid find
assert.are.equal("2", id)
Expand Down Expand Up @@ -309,13 +309,13 @@ describe("org-roam.api.node", function()
roam.api.find_node({}, function(_id) id = _id end)

-- Wait a bit for the capture buffer to appear
vim.wait(100)
utils.wait()

-- Save the capture buffer and exit it
vim.cmd("wq")

-- Wait a bit for the capture to be processed
vim.wait(100)
utils.wait()

-- We should have an id for a valid find
assert.is_not_nil(id)
Expand Down
7 changes: 7 additions & 0 deletions spec/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ function M.autogroup_name()
return AUGROUP_NAME
end

---Waits a standard amount of time for a test.
---This can be adjusted for CI usage.
---@param time? integer
function M.wait(time)
vim.wait(time or 300)
end

---Takes string, splits into lines, and removes common indentation.
---@param s string
---@return string
Expand Down

0 comments on commit 68e3d53

Please sign in to comment.