From 8a061c269dbf95e23f11d7ad97a490f23c22461b Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 4 Nov 2024 11:49:19 +0000 Subject: [PATCH] use incomplete tag if practitioner yet to submit --- app/helpers/admin/claims_helper.rb | 5 ++++- spec/factories/claims.rb | 4 ++++ spec/helpers/admin/claims_helper_spec.rb | 19 ++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/helpers/admin/claims_helper.rb b/app/helpers/admin/claims_helper.rb index b43f9fbaec..8343a4f287 100644 --- a/app/helpers/admin/claims_helper.rb +++ b/app/helpers/admin/claims_helper.rb @@ -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? diff --git a/spec/factories/claims.rb b/spec/factories/claims.rb index ad6b25c8bf..ad5c758648 100644 --- a/spec/factories/claims.rb +++ b/spec/factories/claims.rb @@ -330,6 +330,10 @@ end end + trait :awaiting_practitioner do + submitted_at { nil } + end + trait :with_dqt_teacher_status do dqt_teacher_status do { diff --git a/spec/helpers/admin/claims_helper_spec.rb b/spec/helpers/admin/claims_helper_spec.rb index a37a92d689..2babca4a55 100644 --- a/spec/helpers/admin/claims_helper_spec.rb +++ b/spec/helpers/admin/claims_helper_spec.rb @@ -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( @@ -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) { [] }