fix specs

This commit is contained in:
Lisa Durand 2023-10-19 17:42:10 +02:00
parent 03dd6218f8
commit 48ee575990
2 changed files with 10 additions and 6 deletions

View file

@ -40,8 +40,9 @@ describe 'Creating a new procedure', js: true, retry: 3 do
expect(page).to have_content('Formulaire enregistré') expect(page).to have_content('Formulaire enregistré')
expect(page).to have_selector('select > optgroup', count: 8) expect(page).to have_selector('select > optgroup', count: 8)
page.refresh within(find('.type-de-champ-add-button', match: :first)) {
add_champ add_champ
}
expect(page).to have_selector('.type-de-champ', count: 1) expect(page).to have_selector('.type-de-champ', count: 1)
end end

View file

@ -30,8 +30,9 @@ describe 'As an administrateur I can edit types de champ', js: true, retry: 3 do
scenario "adding multiple champs" do scenario "adding multiple champs" do
# Champs are created when clicking the 'Add field' button # Champs are created when clicking the 'Add field' button
add_champ add_champ
page.refresh within(find('.type-de-champ-add-button', match: :first)) {
add_champ add_champ
}
within(find('.type-de-champ-add-button', match: :first)) { within(find('.type-de-champ-add-button', match: :first)) {
add_champ add_champ
} }
@ -212,8 +213,10 @@ describe 'As an administrateur I can edit types de champ', js: true, retry: 3 do
first_header = procedure.active_revision.types_de_champ_public.first first_header = procedure.active_revision.types_de_champ_public.first
select('Titre de niveau 1', from: dom_id(first_header, :header_section_level)) select('Titre de niveau 1', from: dom_id(first_header, :header_section_level))
page.refresh within(find('.type-de-champ-add-button', match: :first)) {
add_champ add_champ
}
wait_until { procedure.reload.active_revision.types_de_champ_public.count == 2 } wait_until { procedure.reload.active_revision.types_de_champ_public.count == 2 }
second_header = procedure.active_revision.types_de_champ_public.last second_header = procedure.active_revision.types_de_champ_public.last
select('Titre de section', from: dom_id(second_header, :type_champ)) select('Titre de section', from: dom_id(second_header, :type_champ))