Skip to content

Commit

Permalink
fix spec and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mfo committed Feb 14, 2025
1 parent df574d7 commit 24dbe0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
= @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, data: { controller: 'turbo-input format', format: 'deleteSpace', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: update_path }, required: @champ.required?, pattern: "W[0-9A-Z]{9}", class: "width-33-desktop", maxlength: 10, size: nil))

16 changes: 6 additions & 10 deletions spec/controllers/champs/rna_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@
expect(champ.reload.data).to be_nil
end

# TODO, mfo-corinne-rna
xit 'clears any information or error message' do
# subject
# expect(response.body).to include(ActionView::RecordIdentifier.dom_id(champ, :rna_info))
# expect(response.body).to include(champ.input_group_id)
it 'keep assertive div with error id' do
subject
expect(response.body).to include(champ.error_id)
end

it 'updates dossier.last_champs_updated_at' do
Expand All @@ -69,11 +67,9 @@
expect(champ.reload.data).to be_nil
end

# TODO, mfo-corinne-rna
xit 'displays a “RNA is invalid” error message' do
# subject
# expect(response.body).to include("Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres ou lettres")
# expect(response.body).to include("doit commencer par un W majuscule suivi de 9 chiffres ou lettres")
it 'displays a “RNA is invalid” error message' do
subject
expect(response.body).to include("doit commencer par un W majuscule suivi de 9 chiffres ou lettres, saisissez un numéro RNA valide")
end

it 'updates dossier.last_champs_updated_at' do
Expand Down

0 comments on commit 24dbe0c

Please sign in to comment.