fix(procedure): error descriptor link for v2 attestation
This commit is contained in:
parent
e8a671e081
commit
4eeaba5e60
3 changed files with 8 additions and 5 deletions
|
@ -43,7 +43,11 @@ class Procedure::ErrorsSummary < ApplicationComponent
|
|||
tdc = error.options[:type_de_champ]
|
||||
annotations_admin_procedure_path(@procedure, anchor: dom_id(tdc.stable_self, :editor_error))
|
||||
when :attestation_template
|
||||
edit_admin_procedure_attestation_template_path(@procedure)
|
||||
if error.detail[:value].version == 1
|
||||
edit_admin_procedure_attestation_template_path(@procedure)
|
||||
else
|
||||
edit_admin_procedure_attestation_template_v2_path(@procedure)
|
||||
end
|
||||
when :initiated_mail, :received_mail, :closed_mail, :refused_mail, :without_continuation_mail, :re_instructed_mail
|
||||
klass = "Mails::#{error.attribute.to_s.classify}".constantize
|
||||
edit_admin_procedure_mail_template_path(@procedure, klass.const_get(:SLUG))
|
||||
|
|
|
@ -76,8 +76,7 @@ module Administrateurs
|
|||
types_de_champ: [],
|
||||
revision_types_de_champ: { type_de_champ: { piece_justificative_template_attachment: :blob } }
|
||||
},
|
||||
attestation_template_v1: [],
|
||||
attestation_templates_v2: [],
|
||||
attestation_template: [],
|
||||
initiated_mail: [],
|
||||
received_mail: [],
|
||||
closed_mail: [],
|
||||
|
|
|
@ -101,7 +101,7 @@ describe Procedure::ErrorsSummary, type: :component do
|
|||
|
||||
it 'render error nicely' do
|
||||
expect(page).to have_selector("a", text: "Les règles d’inéligibilité")
|
||||
expect(page).to have_selector("a", text: "Le modèle d’attestation")
|
||||
expect(page).to have_selector("a[href*='v2']", text: "Le modèle d’attestation")
|
||||
expect(page).to have_selector("a", text: "L’email de notification de passage de dossier en instruction")
|
||||
expect(page).to have_text("n'est pas valide", count: 2)
|
||||
end
|
||||
|
@ -118,7 +118,7 @@ describe Procedure::ErrorsSummary, type: :component do
|
|||
end
|
||||
|
||||
it 'render error nicely' do
|
||||
expect(page).to have_selector("a", text: "Le modèle d’attestation")
|
||||
expect(page).to have_selector("a:not([href*='v2'])", text: "Le modèle d’attestation")
|
||||
expect(page).to have_text("n'est pas valide", count: 1)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue