amelioration(expert/avis/header): passe d'un dropdown avec un element pour telecharger le dossier au composant dsfr de telechargement de fichier

This commit is contained in:
Martin 2023-01-05 10:52:46 +01:00 committed by mfo
parent cd75c7a1de
commit 9a12b97424
3 changed files with 10 additions and 11 deletions

View file

@ -9,11 +9,11 @@
%li= link_to("Dossier nº #{dossier.id}", expert_avis_path(avis.procedure, avis))
.header-actions
%span.dropdown.print-menu-opener{ data: { controller: 'menu-button' } }
%button.button.dropdown-button.icon-only{ data: { menu_button_target: 'button' } }
%span.icon.attached
%ul.print-menu.dropdown-content#print-pj-menu{ data: { menu_button_target: 'menu' } }
%li= link_to "Télécharger le dossier et toutes ses pièces jointes", telecharger_pjs_expert_avis_path(avis.procedure, avis), target: "_blank", rel: "noopener", class: "menu-item menu-link"
.fr-download
= link_to telecharger_pjs_expert_avis_path(avis.procedure, avis), download: :download, class: "menu-item menu-link fr-download__link" do
Télécharger le dossier et toutes ses pièces jointes
%span.fr-download__detail
ZIP
%nav.tabs
%ul

View file

@ -116,7 +116,6 @@ describe 'Inviting an expert:' do
click_on '1 avis à donner'
click_on avis.dossier.user.email
find(:css, '[aria-controls=print-pj-menu]').click
click_on 'Télécharger le dossier et toutes ses pièces jointes'
# For some reason, clicking the download link does not trigger the download in the headless browser ;
# So we need to go to the download link directly

View file

@ -27,7 +27,7 @@ describe 'users/dossiers/show/header.html.haml', type: :view do
end
it 'can download the dossier' do
expect(rendered).to have_text("Tout le dossier")
expect(rendered).to have_selector('a[title="Tout le dossier"]')
end
end
@ -45,7 +45,7 @@ describe 'users/dossiers/show/header.html.haml', type: :view do
end
it 'can download the dossier' do
expect(rendered).to have_text("Tout le dossier")
expect(rendered).to have_selector('a[title="Tout le dossier"]')
end
it 'does not display a new procedure link' do
@ -68,7 +68,7 @@ describe 'users/dossiers/show/header.html.haml', type: :view do
end
it 'can download the dossier' do
expect(rendered).to have_text("Tout le dossier")
expect(rendered).to have_selector('a[title="Tout le dossier"]')
end
it 'displays a new procedure link' do
@ -105,7 +105,7 @@ describe 'users/dossiers/show/header.html.haml', type: :view do
end
it 'can download the dossier' do
expect(rendered).to have_text("Tout le dossier")
expect(rendered).to have_selector('a[title="Tout le dossier"]')
end
end
@ -124,7 +124,7 @@ describe 'users/dossiers/show/header.html.haml', type: :view do
end
it 'can not download the dossier' do
expect(rendered).not_to have_text("Tout le dossier")
expect(rendered).not_to have_selector('a[title="Tout le dossier"]')
end
end
end