fix specs

This commit is contained in:
Lisa Durand 2023-06-28 12:48:47 +02:00
parent 3d20ef6af9
commit 77240f40c8
6 changed files with 16 additions and 17 deletions

View file

@ -76,7 +76,7 @@
.flex.justify-end
= render partial: 'dossier_actions', locals: { dossier: dossier }
= paginate dossiers, views_prefix: 'shared'
= paginate dossiers, views_prefix: 'shared'
- else

View file

@ -461,9 +461,7 @@ en:
dossiers: "My files"
dossiers_list:
caption: My files
procedure: "Procedure"
n_dossier: "File n."
status: "Status"
no_result_title: No files
no_result_text_html: "To fill a procedure, contact your administration asking for the procedure link. <br> It should look like %{app_base}/commencer/xxx."
no_result_text_with_filter: found with selected filters

View file

@ -463,9 +463,7 @@ fr:
dossiers: "Mes dossiers"
dossiers_list:
caption: Mes dossiers
procedure: "Démarche"
n_dossier: "Nº dossier"
status: "Statut"
no_result_title: Aucun dossier
no_result_text_html: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche. <br> Celui ci doit ressembler à %{app_base}/commencer/xxx."
no_result_text_with_filter: ne correspond aux filtres sélectionnés

View file

@ -149,13 +149,13 @@ describe 'Invitations' do
def navigate_to_brouillon(dossier)
expect(page).to have_current_path(dossiers_path)
click_on(dossier.id.to_s)
click_on(dossier.procedure.libelle)
expect(page).to have_current_path(brouillon_dossier_path(dossier))
end
def navigate_to_dossier(dossier)
expect(page).to have_current_path(dossiers_path)
click_on(dossier.id.to_s)
click_on(dossier.procedure.libelle)
expect(page).to have_current_path(dossier_path(dossier))
end

View file

@ -157,15 +157,16 @@ describe 'user access to the list of their dossiers', js: true do
context 'when user clicks on delete button', js: true do
scenario 'the dossier is deleted' do
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
click_on 'Actions'
expect(page).to have_content(dossier_en_construction.procedure.libelle)
within(:css, ".card", match: :first) do
click_on 'Autres actions'
page.accept_alert('Confirmer la suppression ?') do
click_on 'Supprimer le dossier'
end
end
expect(page).to have_content('Votre dossier a bien été supprimé')
expect(page).not_to have_content(dossier_brouillon.procedure.libelle)
expect(page).not_to have_content(dossier_en_construction.procedure.libelle)
end
end
@ -177,13 +178,15 @@ describe 'user access to the list of their dossiers', js: true do
end
context 'when user clicks on clone button', js: true do
scenario 'the dossier is deleted' do
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
click_on 'Actions'
scenario 'the dossier is cloned' do
expect(Dossier.count).to eq(8)
within(:css, ".card", match: :first) do
click_on 'Autres actions'
click_on 'Dupliquer ce dossier'
end
expect(page).to have_content("Votre dossier a bien été dupliqué. Vous pouvez maintenant le vérifier, ladapter puis le déposer.")
expect(Dossier.count).to eq(9)
end
end
end

View file

@ -24,19 +24,19 @@ describe 'users/dossiers/index', type: :view do
render
end
it 'affiche la liste des dossiers' do
expect(rendered).to have_selector('.dossiers-table tbody tr', count: 3)
it 'affiche les dossiers' do
expect(rendered).to have_selector('.card', count: 3)
end
it 'affiche les informations des dossiers' do
dossier = user_dossiers.first
expect(rendered).to have_text(dossier_brouillon.id.to_s)
expect(rendered).to have_text(dossier_brouillon.procedure.libelle)
expect(rendered).to have_link(dossier_brouillon.id.to_s, href: brouillon_dossier_path(dossier_brouillon))
expect(rendered).to have_link(dossier_brouillon.procedure.libelle, href: brouillon_dossier_path(dossier_brouillon))
expect(rendered).to have_text(dossier_en_construction.id.to_s)
expect(rendered).to have_text(dossier_en_construction.procedure.libelle)
expect(rendered).to have_link(dossier_en_construction.id.to_s, href: dossier_path(dossier_en_construction))
expect(rendered).to have_link(dossier_en_construction.procedure.libelle, href: dossier_path(dossier_en_construction))
end
it 'naffiche pas une alerte pour continuer à remplir un dossier' do