Merge pull request #7863 from mfo/US/stress-wcag-tests

Us/stress wcag tests
This commit is contained in:
mfo 2022-11-08 16:59:16 +01:00 committed by GitHub
commit 6d68c581af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 19 deletions

View file

@ -259,11 +259,6 @@
border-bottom: none;
}
a {
color: $dark-grey;
background-image: none; // remove DSFR underline
}
// Make child links fill the whole clickable area
> a {
display: flex;

View file

@ -13,10 +13,6 @@
padding: 0;
}
thead a {
color: #000000;
}
a {
background-image: none; // remove DSFR underline
}
@ -28,7 +24,6 @@
}
.cell-link {
color: $black;
// In order to have identical height in the table header and the table rows,
// we compensate for the height difference between the biggest element of the header
// (the Personnaliser button, 38px) and the biggest cell-link element of the rows (the label, 28px)

View file

@ -40,6 +40,16 @@ export class MenuButtonController extends ApplicationController {
for (const menuItem of this.menuTarget.querySelectorAll('a')) {
menuItem.setAttribute('role', 'menuitem');
}
for (const dropdownItems of this.menuTarget.querySelectorAll(
'.dropdown-items'
)) {
dropdownItems.setAttribute('role', 'none');
}
for (const dropdownItems of this.menuTarget.querySelectorAll(
'.dropdown-items > li'
)) {
dropdownItems.setAttribute('role', 'none');
}
}
this.on('click', (event) => {
@ -68,7 +78,7 @@ export class MenuButtonController extends ApplicationController {
}
private open(focusMenuItem: 'first' | 'last' = 'first') {
this.buttonTarget.setAttribute('aria-expanded', '');
this.buttonTarget.setAttribute('aria-expanded', 'true');
this.menuTarget.parentElement?.classList.add('open');
this.menuTarget.focus();

View file

@ -44,6 +44,12 @@ describe 'wcag rules for usager', js: true do
visit commencer_path(path: procedure.reload.path)
expect(page).to be_axe_clean
end
scenario 'commencer page, help dropdown' do
visit commencer_path(path: procedure.reload.path)
page.find("#help-menu_button").click
expect(page).to be_axe_clean
end
end
context "logged in, depot d'un dossier as individual" do
@ -66,7 +72,7 @@ describe 'wcag rules for usager', js: true do
fill_in('individual_nom', with: 'nom')
click_on 'Continuer'
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
expect(page).to be_axe_clean
end
end
@ -80,24 +86,37 @@ describe 'wcag rules for usager', js: true do
scenario "écran identification de l'entreprise" do
click_on 'Commencer la démarche'
expect(page).to be_axe_clean.skipping :label
expect(page).to be_axe_clean
end
end
context "logged in, avec des dossiers dossiers déposés" do
context "logged in, avec des dossiers déposés" do
let(:dossier) { create(:dossier, procedure: procedure, user: litteraire_user) }
before do
login_as litteraire_user, scope: :user
end
scenario 'liste des dossiers' do
scenario 'liste des dossiers sans dossiers' do
visit dossiers_path
expect(page).to be_axe_clean
end
scenario 'liste des dossiers avec des dossiers' do
dossier
visit dossiers_path
expect(page).to be_axe_clean
end
scenario 'liste des dossiers et actions sur le dossier' do
dossier
visit dossiers_path
page.find("#actions_menu_dossier_#{dossier.id}_button").click
expect(page).to be_axe_clean
end
scenario 'dossier' do
visit dossier_path(dossier)
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
expect(page).to be_axe_clean
end
scenario 'merci' do
@ -110,19 +129,21 @@ describe 'wcag rules for usager', js: true do
expect(page).to be_axe_clean
end
scenario 'messagerie' do
scenario 'messagerie avec des messages' do
create(:commentaire, dossier: dossier, instructeur: procedure.instructeurs.first, body: 'hello')
create(:commentaire, dossier: dossier, email: dossier.user.email, body: 'hello')
visit messagerie_dossier_path(dossier)
expect(page).to be_axe_clean
end
scenario 'modifier' do
visit modifier_dossier_path(dossier)
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
expect(page).to be_axe_clean
end
scenario 'brouillon' do
visit brouillon_dossier_path(dossier)
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
expect(page).to be_axe_clean
end
end
end