mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-07 06:25:19 +02:00
Test fixes
This commit is contained in:
parent
3baf60a24f
commit
88359be7e4
2 changed files with 18 additions and 18 deletions
|
@ -124,17 +124,14 @@ class Settings::ApiKeysTest < ApplicationSystemTestCase
|
||||||
# Click the revoke button to open the modal
|
# Click the revoke button to open the modal
|
||||||
click_button "Revoke Key"
|
click_button "Revoke Key"
|
||||||
|
|
||||||
# Wait for the modal to appear and click Confirm
|
# Wait for the dialog and then confirm
|
||||||
# The dialog might take a moment to appear
|
assert_selector "#confirm-dialog", visible: true
|
||||||
sleep 0.5
|
|
||||||
|
|
||||||
within "#confirm-dialog" do
|
within "#confirm-dialog" do
|
||||||
assert_text "Are you sure you want to revoke this API key?"
|
|
||||||
click_button "Confirm"
|
click_button "Confirm"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Wait for the page to update after revoke
|
# Wait for redirect after revoke
|
||||||
sleep 0.5
|
assert_no_selector "#confirm-dialog"
|
||||||
|
|
||||||
assert_text "Create Your API Key"
|
assert_text "Create Your API Key"
|
||||||
assert_text "Get programmatic access to your Maybe data"
|
assert_text "Get programmatic access to your Maybe data"
|
||||||
|
|
|
@ -117,23 +117,26 @@ class TransactionsTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_text "No entries found"
|
assert_text "No entries found"
|
||||||
|
|
||||||
|
# Wait for Turbo to finish updating the DOM
|
||||||
|
sleep 0.5
|
||||||
|
|
||||||
# Page reload doesn't affect results
|
# Page reload doesn't affect results
|
||||||
visit current_url
|
visit current_url
|
||||||
|
|
||||||
assert_text "No entries found"
|
assert_text "No entries found"
|
||||||
|
|
||||||
within "ul#transaction-search-filters" do
|
# Remove all filters by clicking their X buttons
|
||||||
find("li", text: account.name).first("button").click
|
# Get all the filter buttons at once to avoid stale elements
|
||||||
find("li", text: "on or after #{10.days.ago.to_date}").first("button").click
|
filter_count = page.all("ul#transaction-search-filters li button").count
|
||||||
find("li", text: "on or before #{1.day.ago.to_date}").first("button").click
|
|
||||||
find("li", text: "Income").first("button").click
|
# Click each one with a small delay to let Turbo update
|
||||||
find("li", text: "less than 200").first("button").click
|
filter_count.times do
|
||||||
find("li", text: category.name).first("button").click
|
page.all("ul#transaction-search-filters li button").first.click
|
||||||
find("li", text: merchant.name).first("button").click
|
sleep 0.1
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_selector "#" + dom_id(@transaction), count: 1
|
assert_text @transaction.name
|
||||||
end
|
end
|
||||||
|
|
||||||
test "can select and deselect entire page of transactions" do
|
test "can select and deselect entire page of transactions" do
|
||||||
|
@ -191,7 +194,7 @@ class TransactionsTest < ApplicationSystemTestCase
|
||||||
fill_in "Date", with: transfer_date
|
fill_in "Date", with: transfer_date
|
||||||
fill_in "model[amount]", with: 175.25
|
fill_in "model[amount]", with: 175.25
|
||||||
click_button "Add transaction"
|
click_button "Add transaction"
|
||||||
within "#entry-group-" + transfer_date.to_s do
|
within "#" + dom_id(investment_account, "entries_#{transfer_date}") do
|
||||||
assert_text "175.25"
|
assert_text "175.25"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue