fix(spec): fill_in(label) search by grep like, so if another label contains your label, you got an Ambiguous match

This commit is contained in:
mfo 2024-10-28 10:39:36 +01:00
parent 84870615d8
commit 2429f11d5c
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC

View file

@ -428,7 +428,7 @@ describe 'The user', js: true do
let(:procedure) do let(:procedure) do
create(:procedure, :published, :for_individual, create(:procedure, :published, :for_individual,
types_de_champ_public: [ types_de_champ_public: [
{ type: :integer_number, libelle: 'age', mandatory: false, stable_id: }, { type: :integer_number, libelle: 'UNIQ_LABEL', mandatory: false, stable_id: },
{ {
type: :repetition, libelle: 'repetition', condition:, children: [ type: :repetition, libelle: 'repetition', condition:, children: [
{ type: :text, libelle: 'nom', mandatory: true } { type: :text, libelle: 'nom', mandatory: true }
@ -441,8 +441,7 @@ describe 'The user', js: true do
log_in(user, procedure) log_in(user, procedure)
fill_individual fill_individual
fill_in('UNIQ_LABEL', with: 10)
fill_in('age', with: 10)
click_on 'Déposer le dossier' click_on 'Déposer le dossier'
expect(page).to have_current_path(merci_dossier_path(user_dossier)) expect(page).to have_current_path(merci_dossier_path(user_dossier))
end end
@ -494,7 +493,7 @@ describe 'The user', js: true do
let(:procedure) do let(:procedure) do
create(:procedure, :published, :for_individual, create(:procedure, :published, :for_individual,
types_de_champ_public: [ types_de_champ_public: [
{ type: :integer_number, libelle: 'age', mandatory: false, stable_id: }, { type: :integer_number, libelle: 'UNIQ_LABEL', mandatory: false, stable_id: },
{ type: :text, libelle: 'nom', mandatory: true, condition: } { type: :text, libelle: 'nom', mandatory: true, condition: }
]) ])
end end
@ -513,7 +512,7 @@ describe 'The user', js: true do
fill_individual fill_individual
fill_in('age', with: '18') fill_in('UNIQ_LABEL', with: '18')
expect(page).to have_css('label', text: 'nom', visible: :visible) expect(page).to have_css('label', text: 'nom', visible: :visible)
expect(page).to have_css('.icon.mandatory') expect(page).to have_css('.icon.mandatory')
click_on 'Déposer le dossier' click_on 'Déposer le dossier'