|
| 1 | +import { testA11y } from 'cypress/support/utils'; |
| 2 | + |
| 3 | +describe('Admin Add New Modals', () => { |
| 4 | + beforeEach(() => { |
| 5 | + // Must login as an Admin for sidebar to appear |
| 6 | + cy.visit('/login'); |
| 7 | + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); |
| 8 | + }); |
| 9 | + |
| 10 | + it('Add new Community modal should pass accessibility tests', () => { |
| 11 | + // Pin the sidebar open |
| 12 | + cy.get('#sidebar-collapse-toggle').click(); |
| 13 | + |
| 14 | + // Click on entry of menu |
| 15 | + cy.get('#admin-menu-section-new-title').click(); |
| 16 | + |
| 17 | + cy.get('a[data-test="menu.section.new_community"]').click(); |
| 18 | + |
| 19 | + // Analyze <ds-create-community-parent-selector> for accessibility |
| 20 | + testA11y('ds-create-community-parent-selector'); |
| 21 | + }); |
| 22 | + |
| 23 | + it('Add new Collection modal should pass accessibility tests', () => { |
| 24 | + // Pin the sidebar open |
| 25 | + cy.get('#sidebar-collapse-toggle').click(); |
| 26 | + |
| 27 | + // Click on entry of menu |
| 28 | + cy.get('#admin-menu-section-new-title').click(); |
| 29 | + |
| 30 | + cy.get('a[data-test="menu.section.new_collection"]').click(); |
| 31 | + |
| 32 | + // Analyze <ds-create-collection-parent-selector> for accessibility |
| 33 | + testA11y('ds-create-collection-parent-selector'); |
| 34 | + }); |
| 35 | + |
| 36 | + it('Add new Item modal should pass accessibility tests', () => { |
| 37 | + // Pin the sidebar open |
| 38 | + cy.get('#sidebar-collapse-toggle').click(); |
| 39 | + |
| 40 | + // Click on entry of menu |
| 41 | + cy.get('#admin-menu-section-new-title').click(); |
| 42 | + |
| 43 | + cy.get('a[data-test="menu.section.new_item"]').click(); |
| 44 | + |
| 45 | + // Analyze <ds-create-item-parent-selector> for accessibility |
| 46 | + testA11y('ds-create-item-parent-selector'); |
| 47 | + }); |
| 48 | +}); |
0 commit comments