mirror of
https://github.com/we-promise/sure.git
synced 2026-05-28 15:04:57 +00:00
feat(settings/providers): group providers into Connected and Available
Partition the provider list in the controller into @connected_providers and @available_providers based on provider_summary status, and render each group under its own heading with a count. Auto-open the section when only one provider is connected. Adds an empty-state line when nothing is connected yet. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -48,4 +48,24 @@ class Settings::ProvidersTest < ApplicationSystemTestCase
|
||||
assert details[:open], "Section should open when clicked"
|
||||
details.assert_text "Setup Token"
|
||||
end
|
||||
|
||||
test "groups providers into Connected and Available with counts" do
|
||||
SimplefinItem.create!(family: @family, name: "Test SimpleFIN", access_url: "https://bridge.simplefin.org/simplefin/access")
|
||||
|
||||
visit settings_providers_path
|
||||
|
||||
connected_heading = find("h2", text: /\AConnected/)
|
||||
assert_match(/· 1\z/, connected_heading.text)
|
||||
|
||||
available_heading = find("h2", text: /\AAvailable/)
|
||||
|
||||
connected_y = connected_heading.native.location.y
|
||||
available_y = available_heading.native.location.y
|
||||
simplefin_y = find("details", text: "SimpleFIN").native.location.y
|
||||
binance_y = find("details", text: "Binance").native.location.y
|
||||
|
||||
assert connected_y < simplefin_y, "Connected heading should appear above SimpleFIN section"
|
||||
assert simplefin_y < available_y, "SimpleFIN should appear above Available heading"
|
||||
assert available_y < binance_y, "Available heading should appear above Binance section"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user