Merge pull request #9026 from demarches-simplifiees/less_flacky

Corrige des tests instables
This commit is contained in:
Colin Darie 2023-05-15 10:44:17 +00:00 committed by GitHub
commit b60066bb5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -555,7 +555,7 @@ describe API::V2::GraphqlController do
expect(gql_errors).to be_nil
expect(gql_data[:groupeInstructeurCreer][:errors]).to be_nil
expect(gql_data[:groupeInstructeurCreer][:groupeInstructeur][:id]).not_to be_nil
expect(gql_data[:groupeInstructeurCreer][:groupeInstructeur][:instructeurs]).to eq([{ id: admin.instructeur.to_typed_id, email: admin.instructeur.email }, { id: Instructeur.last.to_typed_id, email: }])
expect(gql_data[:groupeInstructeurCreer][:groupeInstructeur][:instructeurs]).to match_array([{ id: admin.instructeur.to_typed_id, email: admin.instructeur.email }, { id: Instructeur.last.to_typed_id, email: }])
}
end
end
@ -573,7 +573,7 @@ describe API::V2::GraphqlController do
expect(gql_data[:groupeInstructeurAjouterInstructeurs][:warnings]).to eq([message: "yolo nest pas une adresse email valide"])
expect(gql_data[:groupeInstructeurAjouterInstructeurs][:groupeInstructeur][:id]).to eq(groupe_instructeur.to_typed_id)
expect(groupe_instructeur.instructeurs.count).to eq(2)
expect(gql_data[:groupeInstructeurAjouterInstructeurs][:groupeInstructeur][:instructeurs]).to eq([{ id: existing_instructeur.to_typed_id, email: existing_instructeur.email }, { id: Instructeur.last.to_typed_id, email: }])
expect(gql_data[:groupeInstructeurAjouterInstructeurs][:groupeInstructeur][:instructeurs]).to match_array([{ id: existing_instructeur.to_typed_id, email: existing_instructeur.email }, { id: Instructeur.last.to_typed_id, email: }])
}
end

View file

@ -292,6 +292,7 @@ describe 'fetch API Particulier Data', js: true do
end
expect(page).to have_current_path(merci_dossier_path(Dossier.last))
perform_enqueued_jobs
wait_until { cnaf_champ.reload.data.present? }
visit demande_dossier_path(dossier)
@ -349,6 +350,7 @@ describe 'fetch API Particulier Data', js: true do
end
expect(page).to have_current_path(merci_dossier_path(Dossier.last))
perform_enqueued_jobs
wait_until { pole_emploi_champ.reload.data.present? }
visit demande_dossier_path(dossier)
@ -421,6 +423,7 @@ describe 'fetch API Particulier Data', js: true do
end
expect(page).to have_current_path(merci_dossier_path(Dossier.last))
perform_enqueued_jobs
wait_until { mesri_champ.reload.data.present? }
visit demande_dossier_path(dossier)
@ -486,6 +489,7 @@ describe 'fetch API Particulier Data', js: true do
end
expect(page).to have_current_path(merci_dossier_path(Dossier.last))
perform_enqueued_jobs
wait_until { dgfip_champ.reload.data.present? }
visit demande_dossier_path(dossier)

View file

@ -473,6 +473,7 @@ describe 'The user' do
fill_in('texte obligatoire', with: 'a valid user input')
wait_for_autosave
wait_until { champ_value_for('texte obligatoire') == 'a valid user input' }
visit current_path
expect(page).to have_field('texte obligatoire', with: 'a valid user input')
@ -492,6 +493,7 @@ describe 'The user' do
allow_any_instance_of(Users::DossiersController).to receive(:update).and_call_original
click_on 'Réessayer'
wait_for_autosave
wait_until { champ_value_for('texte obligatoire') == 'a valid user input' }
visit current_path
expect(page).to have_field('texte obligatoire', with: 'a valid user input')