mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Show disabled import options when no accounts exist (#977)
* Show disabled import options before accounts exist Keep account-dependent import choices visible on /imports/new and render them as disabled with guidance when no accounts are available. * Refactor disabled import options: extract partial, fix accessibility (#986) - Extract _import_option partial to eliminate duplicated enabled/disabled markup across TransactionImport, TradeImport, and MintImport (also used by AccountImport, CategoryImport, RuleImport for consistency) - Replace misleading chevron-right with lock icon in disabled state - Add aria-disabled="true" for screen reader accessibility - Remove redundant default: parameter from t() call - Fix locale key ordering (requires_account after import_* keys) - Fix extra blank line in test file - Add assertion for aria-disabled attribute in test https://claude.ai/code/session_016j9tDYEBfWX9Dzd99rAYjX Co-authored-by: Claude <noreply@anthropic.com> * Tailwind fixes --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,20 @@ class ImportsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_select "turbo-frame#modal"
|
||||
end
|
||||
|
||||
test "shows disabled account-dependent imports when family has no accounts" do
|
||||
sign_in users(:empty)
|
||||
|
||||
get new_import_url
|
||||
|
||||
assert_response :success
|
||||
assert_select "button", text: "Import accounts"
|
||||
assert_select "button", text: "Import transactions", count: 0
|
||||
assert_select "button", text: "Import investments", count: 0
|
||||
assert_select "button", text: "Import from Mint", count: 0
|
||||
assert_select "span", text: "Import accounts first to unlock this option.", count: 3
|
||||
assert_select "div[aria-disabled=true]", count: 3
|
||||
end
|
||||
|
||||
test "creates import" do
|
||||
assert_difference "Import.count", 1 do
|
||||
post imports_url, params: {
|
||||
|
||||
Reference in New Issue
Block a user