Skip to content

Commit

Permalink
use incomplete tag if practitioner yet to submit
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega committed Nov 6, 2024
1 parent 4997175 commit cb047ad
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/helpers/admin/claims_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def claim_route(claim)
def identity_confirmation_task_claim_verifier_match_status_tag(claim)
task = claim.tasks.detect { |t| t.name == "identity_confirmation" }

if task.nil?
if claim.policy == Policies::EarlyYearsPayments && !claim.eligibility.practitioner_journey_completed?
status = "Incomplete"
status_colour = "grey"
elsif task.nil?
status = "Unverified"
status_colour = "grey"
elsif task.passed?
Expand Down
4 changes: 4 additions & 0 deletions spec/factories/claims.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@
end
end

trait :awaiting_practitioner do
submitted_at { nil }
end

trait :with_dqt_teacher_status do
dqt_teacher_status do
{
Expand Down
19 changes: 18 additions & 1 deletion spec/helpers/admin/claims_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@
end

describe "#identity_confirmation_task_claim_verifier_match_status_tag" do
subject(:identity_confirmation_task_claim_verifier_match_status_tag) { helper.identity_confirmation_task_claim_verifier_match_status_tag(claim) }
subject(:identity_confirmation_task_claim_verifier_match_status_tag) do
helper.identity_confirmation_task_claim_verifier_match_status_tag(claim)
end

let(:claim) do
build(
Expand All @@ -182,6 +184,21 @@
)
end

context "EY specific and practitioner yet to complete their half" do
let(:claim) do
build(
:claim,
:awaiting_practitioner,
policy: Policies::EarlyYearsPayments
)
end

it "return incomplete grey tag" do
expect(subject).to match("Incomplete")
expect(subject).to match("grey")
end
end

context "without task" do
let(:claim_tasks) { [] }

Expand Down

0 comments on commit cb047ad

Please sign in to comment.