From 3a1614f96dd7846e992fbbdaf8228e175059a931 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 10 May 2023 10:29:23 +0200 Subject: [PATCH 1/2] try fix upload pj spec --- spec/system/users/en_construction_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/users/en_construction_spec.rb b/spec/system/users/en_construction_spec.rb index 51d3ded7c..9840a84bd 100644 --- a/spec/system/users/en_construction_spec.rb +++ b/spec/system/users/en_construction_spec.rb @@ -17,6 +17,7 @@ describe "Dossier en_construction" do expect(page).not_to have_button("Remplacer") click_on "Supprimer le fichier toto.txt" + wait_until { champ.reload.for_export.blank? } expect(page).not_to have_text("toto.txt") end @@ -34,6 +35,7 @@ describe "Dossier en_construction" do expect(page).to have_selector(input_selector) find(input_selector).attach_file(Rails.root.join('spec/fixtures/files/file.pdf')) + wait_until { champ.reload.for_export == 'file.pdf' } expect(page).to have_text("file.pdf") expect(page).not_to have_text("toto.txt") end From 6d73faf90b38d0fbaab20e45aa5959b5a401eedb Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 10 May 2023 10:41:17 +0200 Subject: [PATCH 2/2] try fix api particulier spec --- spec/system/api_particulier/api_particulier_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/system/api_particulier/api_particulier_spec.rb b/spec/system/api_particulier/api_particulier_spec.rb index fff3e7f5c..4f6e5c07a 100644 --- a/spec/system/api_particulier/api_particulier_spec.rb +++ b/spec/system/api_particulier/api_particulier_spec.rb @@ -292,6 +292,8 @@ describe 'fetch API Particulier Data', js: true do end expect(page).to have_current_path(merci_dossier_path(Dossier.last)) + wait_until { cnaf_champ.reload.data.present? } + visit demande_dossier_path(dossier) expect(page).to have_content(/Des données.*ont été reçues depuis la CAF/) @@ -347,6 +349,8 @@ describe 'fetch API Particulier Data', js: true do end expect(page).to have_current_path(merci_dossier_path(Dossier.last)) + wait_until { pole_emploi_champ.reload.data.present? } + visit demande_dossier_path(dossier) expect(page).to have_content(/Des données.*ont été reçues depuis Pôle emploi/) @@ -417,6 +421,8 @@ describe 'fetch API Particulier Data', js: true do end expect(page).to have_current_path(merci_dossier_path(Dossier.last)) + wait_until { mesri_champ.reload.data.present? } + visit demande_dossier_path(dossier) expect(page).to have_content(/Des données.*ont été reçues depuis le MESRI/) @@ -480,6 +486,8 @@ describe 'fetch API Particulier Data', js: true do end expect(page).to have_current_path(merci_dossier_path(Dossier.last)) + wait_until { dgfip_champ.reload.data.present? } + visit demande_dossier_path(dossier) expect(page).to have_content(/Des données.*ont été reçues depuis la DGFiP/)