From cf3249dba52c9dc68df5989a39c8c92938155727 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 23 Oct 2023 12:12:36 +0200 Subject: [PATCH] fix(address): champ address should allow custom values --- .../address_component/address_component.html.haml | 2 +- spec/system/users/brouillon_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/components/editable_champ/address_component/address_component.html.haml b/app/components/editable_champ/address_component/address_component.html.haml index c8a590d7c..a065d0432 100644 --- a/app/components/editable_champ/address_component/address_component.html.haml +++ b/app/components/editable_champ/address_component/address_component.html.haml @@ -1,2 +1,2 @@ -= render Dsfr::ComboboxComponent.new form: @form, name: :value, url: data_sources_data_source_adresse_path, selected: @champ.value, id: @champ.input_id, class: 'fr-select', describedby: @champ.describedby_id do += render Dsfr::ComboboxComponent.new form: @form, name: :value, url: data_sources_data_source_adresse_path, selected: @champ.value, id: @champ.input_id, class: 'fr-select', describedby: @champ.describedby_id, allows_custom_value: true do = @form.hidden_field :external_id, data: { value_slot: 'value' } diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index 29c88d749..54a58526f 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -176,6 +176,17 @@ describe 'The user' do expect(page).to have_current_path(merci_dossier_path(user_dossier)) end + scenario 'fill address not in BAN', js: true, retry: 3 do + log_in(user, procedure) + fill_individual + + fill_in('address', with: '2 rue de la paix, 92094 Belgique') + wait_until { + champ_value_for('address') == '2 rue de la paix, 92094 Belgique' + } + expect(champ_for('address').full_address?).to be_falsey + end + scenario 'numbers champs formatting', js: true, retry: 3 do log_in(user, simple_procedure) fill_individual