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 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module AssessorInterface
class ReviewVerificationsController < BaseController
include RegionHelper
syed87 marked this conversation as resolved.
Show resolved Hide resolved
before_action :authorize_assessor

def index
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) == "teaching authority") ? "Contact relevant competent authority" : region_teaching_authority_name(@application_form.region),
syed87 marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -11,6 +11,8 @@ class ReviewVerifications < SitePrism::Page
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
end
Expand Down
3 changes: 3 additions & 0 deletions spec/support/autoload/page_objects/task_list.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module PageObjects
class TaskList < SitePrism::Section
element :not_started_status, ".govuk-tag.govuk-tag--grey"
element :accepted_status, ".govuk-tag.govuk-tag--green"
syed87 marked this conversation as resolved.
Show resolved Hide resolved
syed87 marked this conversation as resolved.
Show resolved Hide resolved

sections :sections, TaskListSection, ".app-task-list > li"

def find_item(text)
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