mirror of
https://github.com/we-promise/sure.git
synced 2026-05-08 13:14:58 +00:00
* Initial plan * Fix category delete dialog dropdown overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/200da7a4-fd59-4ae4-a709-f631ccf21e8c Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Tighten category deletion regression test Agent-Logs-Url: https://github.com/we-promise/sure/sessions/200da7a4-fd59-4ae4-a709-f631ccf21e8c Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Fix deletion button text overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/e802e01f-079e-4322-ba03-b222ab5d4b84 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Preserve category menu spacing on mobile Agent-Logs-Url: https://github.com/we-promise/sure/sessions/74b5dd1e-7935-4356-806a-759bff911930 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Prevent account activity label overlap on mobile Agent-Logs-Url: https://github.com/we-promise/sure/sessions/e94027d6-e230-44c8-99a1-6e5645bec82b Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Fix wide account activity category overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/4ad79894-2935-47a3-8d37-037e2bd14376 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Linter * Fix flaky system tests in CI Agent-Logs-Url: https://github.com/we-promise/sure/sessions/3507447f-363f-4759-807c-c62a2858d270 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Reset system test viewport between tests Agent-Logs-Url: https://github.com/we-promise/sure/sessions/357a43b1-11c5-49be-972d-0592a37d97b1 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
66 lines
1.9 KiB
Ruby
66 lines
1.9 KiB
Ruby
require "application_system_test_case"
|
|
|
|
class PropertiesEditTest < ApplicationSystemTestCase
|
|
setup do
|
|
sign_in @user = users(:family_admin)
|
|
|
|
Family.any_instance.stubs(:get_link_token).returns("test-link-token")
|
|
|
|
visit root_url
|
|
open_new_account_modal
|
|
create_new_property_account
|
|
end
|
|
|
|
test "can persist property subtype" do
|
|
click_link "[system test] Property Account"
|
|
find("[data-testid='account-menu']").click
|
|
click_on "Edit"
|
|
assert_equal "single_family_home", find("#account_accountable_attributes_subtype").value
|
|
end
|
|
|
|
private
|
|
|
|
def open_new_account_modal
|
|
within "[data-controller='DS--tabs']" do
|
|
click_button "All"
|
|
click_link "New account"
|
|
end
|
|
end
|
|
|
|
def create_new_property_account
|
|
click_link "Property"
|
|
|
|
account_name = "[system test] Property Account"
|
|
fill_in "Name*", with: account_name
|
|
select "Single Family Home", from: "Property type*"
|
|
fill_in "Year Built (optional)", with: 2005
|
|
fill_in "Area (optional)", with: 2250
|
|
|
|
click_button "Next"
|
|
|
|
# Step 2: Enter balance information
|
|
assert_text "Value"
|
|
fill_in "account[balance]", with: 500000
|
|
click_button "Next"
|
|
|
|
# Step 3: Enter address information
|
|
assert_text "Address"
|
|
fill_in "Address Line 1", with: "123 Main St"
|
|
fill_in "City", with: "San Francisco"
|
|
fill_in "State/Region", with: "CA"
|
|
fill_in "Postal Code", with: "94101"
|
|
fill_in "Country", with: "US"
|
|
|
|
click_button "Save"
|
|
|
|
# Verify account was created and is now active
|
|
assert_text account_name
|
|
|
|
created_account = Account.order(:created_at).last
|
|
assert_equal "active", created_account.status
|
|
assert_equal 500000, created_account.balance
|
|
assert_equal "123 Main St", created_account.property.address.line1
|
|
assert_equal "San Francisco", created_account.property.address.locality
|
|
end
|
|
end
|