mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-21 06:09:38 +02:00
27 lines
855 B
Ruby
27 lines
855 B
Ruby
|
require "application_system_test_case"
|
||
|
|
||
|
class TooltipsTest < ApplicationSystemTestCase
|
||
|
include ActionView::Helpers::NumberHelper
|
||
|
include ApplicationHelper
|
||
|
|
||
|
setup do
|
||
|
sign_in @user = users(:family_admin)
|
||
|
@account = accounts(:investment)
|
||
|
end
|
||
|
|
||
|
test "can see account information tooltip" do
|
||
|
visit account_path(@account)
|
||
|
find('[data-controller="tooltip"]').hover
|
||
|
assert find("#tooltip", visible: true)
|
||
|
within "#tooltip" 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)
|
||
|
assert_text I18n.t("accounts.tooltip.cash")
|
||
|
assert_text format_money(@account.balance_money, precision: 0)
|
||
|
end
|
||
|
find("body").click
|
||
|
assert find("#tooltip", visible: false)
|
||
|
end
|
||
|
end
|