mirror of
https://github.com/we-promise/sure.git
synced 2026-04-25 06:54:07 +00:00
Address review feedback for dashboard outflows investment contributions
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/81bb8eeb-1c0b-4a7f-b939-187061c41f22 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
This commit is contained in:
@@ -55,7 +55,15 @@ class PagesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
get root_path
|
||||
assert_response :ok
|
||||
assert_select "#outflows-donut-section", text: /#{Regexp.escape(Category.investment_contributions_name)}/
|
||||
expected_name = Category.investment_contributions_name
|
||||
assert_select "#outflows-donut-section", text: /#{Regexp.escape(expected_name)}/
|
||||
|
||||
donut_node = Nokogiri::HTML(response.body).at_css("[data-controller='donut-chart']")
|
||||
segments = JSON.parse(donut_node["data-donut-chart-segments-value"])
|
||||
contribution_segment = segments.find { |segment| segment["name"] == expected_name }
|
||||
|
||||
assert_not_nil contribution_segment
|
||||
assert_equal 300.0, contribution_segment["amount"]
|
||||
end
|
||||
|
||||
test "changelog" do
|
||||
|
||||
Reference in New Issue
Block a user