feat: add currency management for families with enabled currencies (#1419)

* feat: add currency management for families with enabled currencies

* feat: update currency selection logic and improve accessibility

* feat: update currency preferences to use group moniker in titles

---------

Signed-off-by: Ang Wei Feng (Ted) <hello@tedawf.com>
Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
Ang Wei Feng (Ted)
2026-04-14 01:53:04 +08:00
committed by GitHub
parent 1aa3c8f007
commit 60929cdee0
13 changed files with 322 additions and 18 deletions

View File

@@ -24,4 +24,18 @@ class ApplicationHelperTest < ActionView::TestCase
assert_equal "$0.00", totals_by_currency(collection: [ Account.new(currency: "USD", balance: 0) ], money_method: :balance_money)
assert_equal "-$3.00 | €7.00", totals_by_currency(collection: [ @account1, @account2, @account3 ], money_method: :balance_money, negate: true)
end
test "#currency_picker_options_for_family returns enabled family currencies" do
family = families(:dylan_family)
family.update!(currency: "SGD", enabled_currencies: [ "USD" ])
assert_equal [ "SGD", "USD" ], currency_picker_options_for_family(family)
end
test "#currency_picker_options_for_family keeps selected legacy currency visible" do
family = families(:dylan_family)
family.update!(currency: "SGD", enabled_currencies: [ "USD" ])
assert_equal [ "SGD", "USD", "EUR" ], currency_picker_options_for_family(family, extra: "EUR")
end
end