mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
Improved UI warning states for holdings with missing data (#1098)
* Fix security price issue flow * Fix tooltip positioning and add tooltip for missing holding data * Fix tooltip controller error with stale arrow target * Lint fixes
This commit is contained in:
parent
4527482aa2
commit
1b6ce6af45
16 changed files with 141 additions and 75 deletions
|
@ -89,4 +89,12 @@ class AccountTest < ActiveSupport::TestCase
|
|||
assert_equal 10, account.holding_qty(security, date: 1.day.ago.to_date)
|
||||
assert_equal 0, account.holding_qty(security, date: 2.days.ago.to_date)
|
||||
end
|
||||
|
||||
test "can observe missing price" do
|
||||
account = accounts(:investment)
|
||||
|
||||
assert_difference -> { account.issues.count } do
|
||||
account.observe_missing_price(ticker: "AAPL", date: Date.current)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,9 +11,11 @@ class TooltipsTest < ApplicationSystemTestCase
|
|||
|
||||
test "can see account information tooltip" do
|
||||
visit account_path(@account)
|
||||
find('[data-controller="tooltip"]').hover
|
||||
assert find("#tooltip", visible: true)
|
||||
within "#tooltip" do
|
||||
tooltip_element = find('[data-controller="tooltip"]')
|
||||
tooltip_element.hover
|
||||
tooltip_contents = find('[data-tooltip-target="tooltip"]')
|
||||
assert tooltip_contents.visible?
|
||||
within tooltip_contents do
|
||||
assert_text I18n.t("accounts.tooltip.total_value_tooltip")
|
||||
assert_text I18n.t("accounts.tooltip.holdings")
|
||||
assert_text format_money(@account.investment.holdings_value, precision: 0)
|
||||
|
@ -21,6 +23,6 @@ class TooltipsTest < ApplicationSystemTestCase
|
|||
assert_text format_money(@account.balance_money, precision: 0)
|
||||
end
|
||||
find("body").click
|
||||
assert find("#tooltip", visible: false)
|
||||
assert find('[data-tooltip-target="tooltip"]', visible: false)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue