Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2366 create link with dynamic name #1785

Merged
merged 9 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
syed87 marked this conversation as resolved.
Show resolved Hide resolved
if @professional_standing_request.present?
syed87 marked this conversation as resolved.
Show resolved Hide resolved
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"
syed87 marked this conversation as resolved.
Show resolved Hide resolved

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
Loading