mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
Add accessibility testing for admin sidebar
(cherry picked from commit 31bc05235e
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
4e0a889fa1
commit
75c81b712e
28
cypress/e2e/admin-sidebar.cy.ts
Normal file
28
cypress/e2e/admin-sidebar.cy.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { Options } from 'cypress-axe';
|
||||||
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
|
describe('Admin Sidebar', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
// Must login as an Admin for sidebar to appear
|
||||||
|
cy.visit('/login');
|
||||||
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be pinnable and pass accessibility tests', () => {
|
||||||
|
// Pin the sidebar open
|
||||||
|
cy.get('#sidebar-collapse-toggle').click();
|
||||||
|
|
||||||
|
// Click on every expandable section to open all menus
|
||||||
|
cy.get('ds-expandable-admin-sidebar-section').click({multiple: true});
|
||||||
|
|
||||||
|
// Analyze <ds-admin-sidebar> for accessibility
|
||||||
|
testA11y('ds-admin-sidebar',
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
// Currently all expandable sections have nested interactive elements
|
||||||
|
// See https://github.com/DSpace/dspace-angular/issues/2178
|
||||||
|
'nested-interactive': { enabled: false },
|
||||||
|
}
|
||||||
|
} as Options);
|
||||||
|
});
|
||||||
|
});
|
Reference in New Issue
Block a user