fix(test): update routing tests

This commit is contained in:
Eric Leroy-Terquem 2023-10-18 18:44:52 +02:00
parent cd9cc65e99
commit 3e2e5a01f9
3 changed files with 65 additions and 21 deletions

View file

@ -39,14 +39,14 @@ describe 'The routing with rules', js: true, retry: 3 do
expect(page).not_to have_text('à configurer')
click_on 'littéraire'
expect(page).to have_select("targeted_champ", selected: "Spécialité")
expect(page).to have_select("value", selected: "littéraire")
expect(page).to have_select("groupe_instructeur[condition_form][rows][][targeted_champ]", selected: "Spécialité")
expect(page).to have_select("groupe_instructeur[condition_form][rows][][value]", selected: "littéraire")
click_on '3 groupes'
click_on 'scientifique'
expect(page).to have_select("targeted_champ", selected: "Spécialité")
expect(page).to have_select("value", selected: "scientifique")
expect(page).to have_select("groupe_instructeur[condition_form][rows][][targeted_champ]", selected: "Spécialité")
expect(page).to have_select("groupe_instructeur[condition_form][rows][][value]", selected: "scientifique")
end
scenario 'Routage avancé' do
@ -106,20 +106,20 @@ describe 'The routing with rules', js: true, retry: 3 do
expect(page).to have_text("Linstructeur alain@gouv.fr a été affecté")
# add routing rules
within('.target') { select('Spécialité') }
within('.value') { select('scientifique') }
within('.target select') { select('Spécialité') }
within('.value select') { select('scientifique') }
click_on '3 groupes'
click_on 'littéraire'
within('.target') { select('Spécialité') }
within('.value') { select('scientifique') }
within('.target select') { select('Spécialité') }
within('.value select') { select('scientifique') }
expect(page).to have_text('règle déjà attribuée à scientifique')
within('.target') { select('Spécialité') }
within('.value') { select('littéraire') }
within('.target select') { select('Spécialité') }
within('.value select') { select('littéraire') }
expect(page).not_to have_text('règle déjà attribuée à scientifique')