From 666b51fa9c563d7d2726a9cc48bd30a9cc7b0072 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 19 Jun 2024 21:50:38 +0200 Subject: [PATCH] fix(textarea): merge data controllers from opts & autoresize --- app/components/dsfr/input_errorable.rb | 4 +--- .../administrateurs/procedure_attestation_template_spec.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/components/dsfr/input_errorable.rb b/app/components/dsfr/input_errorable.rb index 836ab9c1b..efe7de775 100644 --- a/app/components/dsfr/input_errorable.rb +++ b/app/components/dsfr/input_errorable.rb @@ -98,9 +98,7 @@ module Dsfr }) end - if autoresize? - @opts.deep_merge!(data: { controller: 'autoresize' }) - end + @opts.deep_merge!(data: { controller: token_list(@opts.dig(:data, :controller), 'autoresize' => autoresize?) }) @opts end diff --git a/spec/system/administrateurs/procedure_attestation_template_spec.rb b/spec/system/administrateurs/procedure_attestation_template_spec.rb index 2eac577b7..ce8ae5998 100644 --- a/spec/system/administrateurs/procedure_attestation_template_spec.rb +++ b/spec/system/administrateurs/procedure_attestation_template_spec.rb @@ -142,7 +142,7 @@ describe 'As an administrateur, I want to manage the procedure’s attestation', } fill_in "Contenu du pied de page", with: ["line1", "line2", "line3", "line4"].join("\n") - expect(page).to have_field("Contenu du pied de page", with: "line1\nline2\nline3\nline4") + expect(page).to have_field("Contenu du pied de page", with: "line1\nline2\nline3line4") click_on "Publier" expect(attestation.reload).to be_published