fix(spec.flacky): ./spec/system/administrateurs/types_de_champ_spec.rb:272 was flacky, try to fix it

This commit is contained in:
Martin 2024-01-22 15:50:38 +01:00
parent 043ffef79a
commit 2fa59076f9

View file

@ -268,7 +268,10 @@ describe 'As an administrateur I can edit types de champ', js: true do
fill_in 'Libellé du champ', with: 'renamed' fill_in 'Libellé du champ', with: 'renamed'
end end
wait_until { initial_first_coordinate.reload.libelle == 'renamed' } wait_until { initial_first_coordinate.reload.libelle == 'renamed' }
# wait until turbo response
expect(page).to have_text('Formulaire enregistré')
page.find(initial_first_coordinate_selector).click page.find(initial_first_coordinate_selector).click
expect(page).to have_css("#{initial_first_coordinate_selector} option", count: 3)
expect(page.find(initial_first_coordinate_selector).all("option").map(&:text)).to match_array(['0 renamed', '1 middle_tdc', '2 last_tdc']) expect(page.find(initial_first_coordinate_selector).all("option").map(&:text)).to match_array(['0 renamed', '1 middle_tdc', '2 last_tdc'])
end end