Skip to content

Commit

Permalink
Merge pull request #1785 from DFE-Digital/2366-create-link-with-dynam…
Browse files Browse the repository at this point in the history
…ic-name

2366 create link with dynamic name
  • Loading branch information
syed87 authored Nov 6, 2023
2 parents 8e949ce + 6d6adda commit fea88ff
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/helpers/region_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def region_certificate_phrase(region)
"#{certificate.indefinite_article} #{tag.span(certificate, lang: region.country.code)}".html_safe
end

def region_teaching_authority_name(region)
region.teaching_authority_name.presence || "teaching authority"
def region_teaching_authority_name(region, default = nil)
region.teaching_authority_name.presence || default || "teaching authority"
end

def region_teaching_authority_name_phrase(region)
Expand Down
23 changes: 14 additions & 9 deletions app/views/assessor_interface/review_verifications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
The following verification tasks have been flagged for review:
</p>

<%= govuk_table do |table|
<%= render(TaskList::Component.new(
if @professional_standing_request.present?
table.with_caption(text: "LoPS")
table.with_body do |body|
body.with_row do |row|
row.with_cell { govuk_link_to region_certificate_name(@application_form.region), [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request] }
row.with_cell { render(StatusTag::Component.new(@professional_standing_request.review_status)) }
end
end
[
{
title: "LoPS",
items: [
{
name: region_teaching_authority_name(@application_form.region, "Contact relevant competent authority"),
link: [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request],
status: @professional_standing_request.review_status,
}
],
}
]
end
end %>
)) %>

<div class="govuk-!-padding-top-3">
<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ class ReviewVerifications < SitePrism::Page
set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \
"/review-verifications"

sections :rows, ".govuk-table__row" do
element :link, ".govuk-link"
element :tag, ".govuk-tag"
end
section :task_list, TaskList, ".app-task-list"

element :back_to_overview_button, ".govuk-button"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def when_i_click_on_assessment_decision
end

def when_i_click_on_lops
assessor_review_verifications_page.rows.first.link.click
assessor_application_page.task_list.click_item(
"Contact relevant competent authority",
)
end

def when_i_fill_in_the_review_lops_form
Expand All @@ -109,15 +111,19 @@ def when_i_click_on_back_to_overview
end

def and_i_see_the_lops_not_started
expect(assessor_review_verifications_page.rows.first.tag.text).to eq(
"NOT STARTED",
)
item =
assessor_review_verifications_page.task_list.find_item(
"Contact relevant competent authority",
)
expect(item.status_tag.text).to eq("NOT STARTED")
end

def and_i_see_the_lops_accepted
expect(assessor_review_verifications_page.rows.first.tag.text).to eq(
"ACCEPTED",
)
item =
assessor_review_verifications_page.task_list.find_item(
"Contact relevant competent authority",
)
expect(item.status_tag.text).to eq("ACCEPTED")
end

def application_form
Expand Down

0 comments on commit fea88ff

Please sign in to comment.