From 7905a4e87082b7159db44a44b98d0a084e9d40ea Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 29 Aug 2023 15:13:14 +0200 Subject: [PATCH] tech(test.flacky): essaie de rendre plus fiable un test flacky sur la configuration des champs d'un formulaire --- spec/system/administrateurs/types_de_champ_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/administrateurs/types_de_champ_spec.rb b/spec/system/administrateurs/types_de_champ_spec.rb index ba5ef35780e..363feaafff0 100644 --- a/spec/system/administrateurs/types_de_champ_spec.rb +++ b/spec/system/administrateurs/types_de_champ_spec.rb @@ -199,6 +199,7 @@ scenario 'invalid order, it pops up errors summary' do add_champ select('Titre de section', from: 'Type de champ') + wait_until { procedure.reload.active_revision.types_de_champ_public.first&.type_champ == TypeDeChamp.type_champs.fetch(:header_section) } first_header = procedure.active_revision.types_de_champ_public.first select('Titre de niveau 1', from: dom_id(first_header, :header_section_level)) @@ -206,6 +207,7 @@ wait_until { procedure.reload.active_revision.types_de_champ_public.count == 2 } second_header = procedure.active_revision.types_de_champ_public.last select('Titre de section', from: dom_id(second_header, :type_champ)) + wait_until { procedure.reload.active_revision.types_de_champ_public.last&.type_champ == TypeDeChamp.type_champs.fetch(:header_section) } select('Titre de niveau 2', from: dom_id(second_header, :header_section_level)) within(".types-de-champ-block li:first-child") do