* Update view logs outcomes link
* Add logs outcomes page
* Set logs outcome before merge and on merge fail
* Update logs outcomes text
* Update line break
{label:"Total users after merge",value:display_value_or_placeholder(merge_request.total_users_label),action:merge_outcome_action(merge_request,"user_outcomes")},
{label:"Total users after merge",value:display_value_or_placeholder(merge_request.total_users_label),action:merge_outcome_action(merge_request,"user_outcomes")},
{label:"Total schemes after merge",value:display_value_or_placeholder(merge_request.total_schemes_label),action:merge_outcome_action(merge_request,"scheme_outcomes")},
{label:"Total schemes after merge",value:display_value_or_placeholder(merge_request.total_schemes_label),action:merge_outcome_action(merge_request,"scheme_outcomes")},
{label:"Total logs after merge",value:merge_request.total_lettings_logs.present?||merge_request.total_sales_logs.present??"#{merge_request.total_lettings_logs} lettings logs<br>#{merge_request.total_sales_logs} sales logs".html_safe:display_value_or_placeholder(nil),action:{text:"View",href:"#",visually_hidden_text:"total logs after merge"}},
{label:"Total logs after merge",value:display_value_or_placeholder(merge_request.total_logs_label),action:merge_outcome_action(merge_request,"logs_outcomes")},
{label:"Total stock owners & managing agents after merge",value:display_value_or_placeholder(merge_request.total_stock_owners_managing_agents_label),action:merge_outcome_action(merge_request,"relationship_outcomes")},
{label:"Total stock owners & managing agents after merge",value:display_value_or_placeholder(merge_request.total_stock_owners_managing_agents_label),action:merge_outcome_action(merge_request,"relationship_outcomes")},
text+="#{merge_request.absorbing_organisation.name} users will have access to all #{type} logs owned or #{managed_or_reported} by the #{merging_organisations} after the merge.<br><br>"
text+="#{type.capitalize} logs that are owned or #{managed_or_reported} by the #{merging_organisations} and have a #{startdate} after the merge date will have their owning or managing organisation changed to #{merge_request.absorbing_organisation.name}.<br><br>"
text+="Some logs are owned and #{managed_or_reported} by different organisations in this merge. They appear in the list for both the owning and the managing organisation.<br><br>"
expect(outcome_text).not_toinclude("Org 1 users will have access to all lettings logs owned or managed by the merging organisation after the merge.")
expect(outcome_text).not_toinclude("Lettings logs that are owned or managed by the merging organisation and have a tenancy start date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).not_toinclude("Some logs are owned and managed by different organisations in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).toinclude("Org 1 and Org 2 have no lettings logs.")
expect(outcome_text).not_toinclude("Org 1 users will have access to all sales logs owned or reported by the merging organisation after the merge.")
expect(outcome_text).not_toinclude("Sales logs that are owned or reported by the merging organisation and have a sale completion date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).not_toinclude("Some logs are owned and reported by different organisation in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).toinclude("Org 1 and Org 2 have no sales logs.")
expect(outcome_text).toinclude("Org 1 users will have access to all lettings logs owned or managed by the merging organisation after the merge.")
expect(outcome_text).toinclude("Lettings logs that are owned or managed by the merging organisation and have a tenancy start date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).not_toinclude("Some logs are owned and managed by different organisations in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).not_toinclude("Org 2 has no lettings logs.")
expect(outcome_text).toinclude("View all 2 Org 2 lettings logs (opens in a new tab)")
expect(outcome_text).toinclude("Org 1 users will have access to all sales logs owned or reported by the merging organisation after the merge.")
expect(outcome_text).toinclude("Sales logs that are owned or reported by the merging organisation and have a sale completion date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).not_toinclude("Some logs are owned and reported by different organisations in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).not_toinclude("Org 2 has no sales logs.")
expect(outcome_text).toinclude("View all 2 Org 2 sales logs (opens in a new tab)")
expect(outcome_text).toinclude("Org 1 users will have access to all lettings logs owned or managed by the merging organisations after the merge.")
expect(outcome_text).toinclude("Lettings logs that are owned or managed by the merging organisations and have a tenancy start date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).toinclude("Some logs are owned and managed by different organisations in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).not_toinclude("Org 2 has no lettings logs.")
expect(outcome_text).toinclude("View all 3 Org 2 lettings logs (opens in a new tab)")
expect(outcome_text).toinclude("View 1 Org 3 lettings log (opens in a new tab)")
expect(outcome_text).toinclude("Org 1 users will have access to all sales logs owned or reported by the merging organisations after the merge.")
expect(outcome_text).toinclude("Sales logs that are owned or reported by the merging organisations and have a sale completion date after the merge date will have their owning or managing organisation changed to Org 1.")
expect(outcome_text).toinclude("Some logs are owned and reported by different organisations in this merge. They appear in the list for both the owning and the managing organisation.")
expect(outcome_text).not_toinclude("Org 2 has no sales logs.")
expect(outcome_text).toinclude("View all 3 Org 2 sales logs (opens in a new tab)")
expect(outcome_text).toinclude("View 1 Org 3 sales log (opens in a new tab)")
expect(page).tohave_link("View all 4 Organisation with some logs lettings logs (opens in a new tab)",href:lettings_logs_organisation_path(organisation_with_some_logs))
expect(page).tohave_link("View all 2 Organisation with some logs sales logs (opens in a new tab)",href:sales_logs_organisation_path(organisation_with_some_logs))
expect(page).tohave_link("View all 2 MHCLG lettings logs (opens in a new tab)",href:lettings_logs_organisation_path(organisation))
expect(page).tohave_link("View all 3 MHCLG sales logs (opens in a new tab)",href:sales_logs_organisation_path(organisation))
expect(page).tohave_content("Organisation with no logs and Organisation with no logs too have no lettings logs.")
expect(page).tohave_content("Organisation with no logs and Organisation with no logs too have no sales logs.")
expect(page).tohave_content("6 lettings logs after merge")
expect(page).tohave_content("5 sales logs after merge")
end
end
end
end
context"when user is signed in with a data coordinator user"do
context"when user is signed in with a data coordinator user"do