refactor(pj): don't poll on antivirus when submitting a pj

Closes #9733
This commit is contained in:
Colin Darie 2023-12-06 15:10:44 +01:00
parent 189b9e5037
commit 0f1980b1c3
9 changed files with 22 additions and 55 deletions

View file

@ -100,7 +100,6 @@ describe 'The user' do
expect(page).to have_selected_value('pays', selected: 'Australie')
expect(page).to have_field('dossier_link', with: '123')
expect(page).to have_text('file.pdf')
expect(page).to have_text('Analyse antivirus en cours')
end
scenario 'fill nothing and every error anchor links points to an existing element', js: true do
@ -290,9 +289,9 @@ describe 'The user' do
find_field('Pièce justificative 2').attach_file(Rails.root + 'spec/fixtures/files/RIB.pdf')
# Expect the files to be uploaded immediately
expect(page).to have_text('Analyse antivirus en cours', count: 2, wait: 5)
expect(page).to have_text('file.pdf')
expect(page).to have_text('RIB.pdf')
expect(page).to have_button("Supprimer", title: "Supprimer le fichier RIB.pdf")
# Expect the submit buttons to be enabled
expect(page).to have_button('Déposer le dossier', disabled: false)
@ -312,7 +311,6 @@ describe 'The user' do
# Test invalid file type
attach_file('Pièce justificative 1', Rails.root + 'spec/fixtures/files/invalid_file_format.json')
expect(page).to have_no_text('La pièce justificative nest pas dun type accepté')
expect(page).to have_text('Analyse antivirus en cours', count: 1, wait: 5)
end
scenario 'retry on transcient upload error', js: true do
@ -333,9 +331,9 @@ describe 'The user' do
# Test that retrying after a failure works
click_on('Réessayer', visible: true, wait: 5)
expect(page).to have_text('Analyse antivirus en cours', wait: 5)
expect(page).to have_text('file.pdf')
expect(page).to have_button('Déposer le dossier', disabled: false)
expect(page).to have_button("Supprimer", title: "Supprimer le fichier file.pdf")
# Reload the current page
visit current_path
@ -350,7 +348,6 @@ describe 'The user' do
attach_file('Pièce justificative 1', Rails.root + 'spec/fixtures/files/file.pdf')
expect(page).to have_text('file.pdf')
expect(page).to have_text('Analyse antivirus en cours')
attach_file('Pièce justificative 1', Rails.root + 'spec/fixtures/files/white.png')
expect(page).to have_text('white.png')
@ -382,7 +379,6 @@ describe 'The user' do
_1.blob.virus_scan_result = ActiveStorage::VirusScanner::SAFE
_1.save!
}
expect(page).not_to have_text('Analyse antivirus en cours', wait: 10)
visit current_path