From 0aba2456cd3068d00b0f97ccff66846453957db1 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 20 Sep 2024 15:24:13 +0200 Subject: [PATCH 1/2] fix(spec): scroll to combobox before filling --- spec/system/instructeurs/procedure_filters_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/system/instructeurs/procedure_filters_spec.rb b/spec/system/instructeurs/procedure_filters_spec.rb index 860caf186..c8b588c89 100644 --- a/spec/system/instructeurs/procedure_filters_spec.rb +++ b/spec/system/instructeurs/procedure_filters_spec.rb @@ -43,7 +43,7 @@ describe "procedure filters" do end end - scenario "should add be able to add created_at column", chrome: true do + scenario "should add be able to add created_at column", js: true do add_column("Créé le") within ".dossiers-table" do expect(page).to have_link("Créé le") @@ -51,7 +51,7 @@ describe "procedure filters" do end end - scenario "should add be able to add and remove custom type_de_champ column", chrome: true do + scenario "should add be able to add and remove custom type_de_champ column", js: true do add_column(type_de_champ.libelle) within ".dossiers-table" do expect(page).to have_link(type_de_champ.libelle) @@ -229,6 +229,7 @@ describe "procedure filters" do def add_column(column_name) click_on 'Personnaliser' + scroll_to(find('input[aria-label="Colonne à afficher"]'), align: :center) select_combobox('Colonne à afficher', column_name) click_button "Enregistrer" end From 356dae446c19b6c8fd8ce5cca66972cd8be24df2 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 20 Sep 2024 15:24:41 +0200 Subject: [PATCH 2/2] fix(spec): make pagination links clickable --- app/views/shared/kaminari/_first_page.html.haml | 2 +- app/views/shared/kaminari/_last_page.html.haml | 2 +- app/views/shared/kaminari/_next_page.html.haml | 2 +- app/views/shared/kaminari/_prev_page.html.haml | 2 +- spec/system/users/list_dossiers_spec.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/shared/kaminari/_first_page.html.haml b/app/views/shared/kaminari/_first_page.html.haml index 4a781e745..724f52f9f 100644 --- a/app/views/shared/kaminari/_first_page.html.haml +++ b/app/views/shared/kaminari/_first_page.html.haml @@ -1,2 +1,2 @@ %li - = link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: 'fr-pagination__link fr-pagination__link--first', 'aria-disabled': true, title: 'Première page', role: 'link' + = link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: 'fr-pagination__link fr-pagination__link--first', title: 'Première page', role: 'link' diff --git a/app/views/shared/kaminari/_last_page.html.haml b/app/views/shared/kaminari/_last_page.html.haml index 7f4bfd218..af2811abf 100644 --- a/app/views/shared/kaminari/_last_page.html.haml +++ b/app/views/shared/kaminari/_last_page.html.haml @@ -1,2 +1,2 @@ %li - = link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, rel: 'next', remote: remote, class: 'fr-pagination__link fr-pagination__link--last', 'aria-disabled': true, title: "Dernière page", role: 'link' + = link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, rel: 'next', remote: remote, class: 'fr-pagination__link fr-pagination__link--last', title: "Dernière page", role: 'link' diff --git a/app/views/shared/kaminari/_next_page.html.haml b/app/views/shared/kaminari/_next_page.html.haml index 405bbaca9..54531dd60 100644 --- a/app/views/shared/kaminari/_next_page.html.haml +++ b/app/views/shared/kaminari/_next_page.html.haml @@ -1,2 +1,2 @@ %li - = link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote, class: 'fr-pagination__link fr-pagination__link--next fr-pagination__link--lg-label', 'aria-disabled': true, role: 'link' + = link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote, class: 'fr-pagination__link fr-pagination__link--next fr-pagination__link--lg-label', role: 'link' diff --git a/app/views/shared/kaminari/_prev_page.html.haml b/app/views/shared/kaminari/_prev_page.html.haml index a62f6dc73..265419213 100644 --- a/app/views/shared/kaminari/_prev_page.html.haml +++ b/app/views/shared/kaminari/_prev_page.html.haml @@ -1,2 +1,2 @@ %li - = link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote, class: 'fr-pagination__link fr-pagination__link--prev fr-pagination__link--lg-label', 'aria-disabled': true, role: 'link' + = link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote, class: 'fr-pagination__link fr-pagination__link--prev fr-pagination__link--lg-label', role: 'link' diff --git a/spec/system/users/list_dossiers_spec.rb b/spec/system/users/list_dossiers_spec.rb index 678e2d827..5d4cc3eac 100644 --- a/spec/system/users/list_dossiers_spec.rb +++ b/spec/system/users/list_dossiers_spec.rb @@ -58,7 +58,7 @@ describe 'user access to the list of their dossiers', js: true do context 'when there is more than one page' do let(:dossiers_per_page) { 2 } - scenario 'the user can navigate through the other pages', chrome: true do + scenario 'the user can navigate through the other pages' do expect(page).not_to have_link(dossier_en_instruction.procedure.libelle) page.click_link("Suivant") page.click_link("Suivant")