mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Basic MyDSpace tests. Fix basic accessibility issues found
This commit is contained in:
38
cypress/integration/my-dspace.spec.ts
Normal file
38
cypress/integration/my-dspace.spec.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { TEST_ADMIN_USER, TEST_ADMIN_PASSWORD } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('My DSpace page', () => {
|
||||
it('should display recent submissions', () => {
|
||||
cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||
|
||||
// This is the GET command that will automatically search for recent submissions
|
||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// Wait for search results to come back from the above GET command
|
||||
cy.wait('@search-results');
|
||||
|
||||
// At least one recent submission should be displayed
|
||||
cy.get('ds-item-search-result-list-element-submission').should('be.visible');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||
cy.visit('/mydspace');
|
||||
|
||||
cy.get('ds-my-dspace-page').should('exist');
|
||||
|
||||
// Analyze <ds-search-page> for accessibility issues
|
||||
testA11y('ds-my-dspace-page',
|
||||
{
|
||||
rules: {
|
||||
// Search filters fail these two "moderate" impact rules
|
||||
'heading-order': { enabled: false },
|
||||
'landmark-unique': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
});
|
||||
});
|
@@ -8,7 +8,7 @@
|
||||
<div class="add w-100" display="dynamic" placement="bottom-right"
|
||||
ngbDropdown
|
||||
*ngIf="(moreThanOne$ | async)">
|
||||
<button class="btn btn-lg btn-outline-primary mt-1 ml-2" id="dropdownSubmission" ngbDropdownToggle
|
||||
<button class="btn btn-lg btn-outline-primary mt-1 ml-2" id="dropdownImport" ngbDropdownToggle
|
||||
type="button" [disabled]="!(initialized$|async)"
|
||||
attr.aria-label="{{'mydspace.new-submission-external' | translate}}"
|
||||
title="{{'mydspace.new-submission-external' | translate}}">
|
||||
@@ -17,8 +17,8 @@
|
||||
</button>
|
||||
<div ngbDropdownMenu
|
||||
class="dropdown-menu"
|
||||
id="entityControlsDropdownMenu"
|
||||
aria-labelledby="dropdownSubmission">
|
||||
id="importControlsDropdownMenu"
|
||||
aria-labelledby="dropdownImport">
|
||||
<ds-entity-dropdown [isSubmission]="false" (selectionChange)="openPage($event)"></ds-entity-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
flex: initial;
|
||||
}
|
||||
|
||||
#entityControlsDropdownMenu {
|
||||
#importControlsDropdownMenu {
|
||||
min-width: 18rem;
|
||||
box-shadow: $btn-focus-box-shadow;
|
||||
}
|
||||
|
@@ -7,7 +7,9 @@
|
||||
ngbDropdown
|
||||
*ngIf="(moreThanOne$ | async)">
|
||||
<button class="btn btn-lg btn-primary mt-1 ml-2" id="dropdownSubmission" ngbDropdownToggle
|
||||
type="button" [disabled]="!(initialized$|async)">
|
||||
type="button" [disabled]="!(initialized$|async)"
|
||||
attr.aria-label="{{'mydspace.new-submission' | translate}}"
|
||||
title="{{'mydspace.new-submission' | translate}}">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user