feat(champ): ask for departement before asking for commune

This commit is contained in:
Paul Chavard 2021-10-26 16:21:47 +02:00 committed by Paul Chavard
parent dc56572b1d
commit ba0211ba52
7 changed files with 132 additions and 49 deletions

View file

@ -104,13 +104,11 @@ module SystemHelpers
end
def select_combobox(champ, fill_with, value)
input = find("input[aria-label=\"#{champ}\"")
input.click
input.fill_in with: fill_with
fill_in champ, with: fill_with
selector = "li[data-option-value=\"#{value}\"]"
find(selector).click
expect(page).to have_css(selector)
expect(page).to have_hidden_field(champ, with: value)
expect(page).to have_css("[type=\"hidden\"][value=\"#{value}\"]")
end
def select_multi_combobox(champ, fill_with, value)

View file

@ -32,6 +32,7 @@ describe 'The user' do
select_combobox('pays', 'aust', 'Australie')
select_combobox('regions', 'Ma', 'Martinique')
select_combobox('departements', 'Ai', '02 - Aisne')
select_combobox('communes', 'Ai', '02 - Aisne')
select_combobox('communes', 'Ambl', 'Ambléon (01300)')
check('engagement')