mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add stimulus tooltip controller (#1065)
* Add Tooltip Stimulus controller * Add test for tooltip * Remove comma * Normalize translations * Use floating-ui instead popper * Use component classes * Increase cross axis value * Cleanup * Update app/views/accounts/show.html.erb Use correct tailwind class Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> Signed-off-by: Tony Vincent <tonyvince7@gmail.com> * Use default values for options * Remove tooltip global variable * Add arrow target * Remove unused method --------- Signed-off-by: Tony Vincent <tonyvince7@gmail.com> Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
This commit is contained in:
parent
6e74414cb2
commit
f315370512
11 changed files with 164 additions and 4 deletions
26
test/system/tooltips_test.rb
Normal file
26
test/system/tooltips_test.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue