File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Options } from 'cypress-axe' ;
2+ import { testA11y } from 'cypress/support/utils' ;
3+
4+ describe ( 'Admin Sidebar' , ( ) => {
5+ beforeEach ( ( ) => {
6+ // Must login as an Admin for sidebar to appear
7+ cy . visit ( '/login' ) ;
8+ cy . loginViaForm ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
9+ } ) ;
10+
11+ it ( 'should be pinnable and pass accessibility tests' , ( ) => {
12+ // Pin the sidebar open
13+ cy . get ( '#sidebar-collapse-toggle' ) . click ( ) ;
14+
15+ // Click on every expandable section to open all menus
16+ cy . get ( 'ds-expandable-admin-sidebar-section' ) . click ( { multiple : true } ) ;
17+
18+ // Analyze <ds-admin-sidebar> for accessibility
19+ testA11y ( 'ds-admin-sidebar' ,
20+ {
21+ rules : {
22+ // Currently all expandable sections have nested interactive elements
23+ // See https://github.com/DSpace/dspace-angular/issues/2178
24+ 'nested-interactive' : { enabled : false } ,
25+ }
26+ } as Options ) ;
27+ } ) ;
28+ } ) ;
You can’t perform that action at this time.
0 commit comments