Skip to content

Commit 00cb2f9

Browse files
committed
Add accessibility tests (and minor fixes) for Edit Collection's Content Source tab and Item Mapper tab
1 parent 9894d31 commit 00cb2f9

4 files changed

Lines changed: 46 additions & 4 deletions

File tree

cypress/e2e/collection-edit.cy.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ describe('Edit Collection > Assign Roles tab', () => {
3333
});
3434
});
3535

36+
describe('Edit Collection > Content Source tab', () => {
37+
38+
it('should pass accessibility tests', () => {
39+
cy.get('a[data-test="source"]').click();
40+
41+
// <ds-collection-source> tag must be loaded
42+
cy.get('ds-collection-source').should('be.visible');
43+
44+
// Check the external source checkbox (to display all fields on the page)
45+
cy.get('#externalSourceCheck').check();
46+
47+
// Wait for the source controls to appear
48+
cy.get('ds-collection-source-controls').should('be.visible');
49+
50+
// Analyze entire page for accessibility issues
51+
testA11y('ds-collection-source');
52+
});
53+
});
54+
3655
describe('Edit Collection > Curate tab', () => {
3756

3857
it('should pass accessibility tests', () => {
@@ -72,6 +91,29 @@ describe('Edit Collection > Authorizations tab', () => {
7291
});
7392
});
7493

94+
describe('Edit Collection > Item Mapper tab', () => {
95+
96+
it('should pass accessibility tests', () => {
97+
cy.get('a[data-test="mapper"]').click();
98+
99+
// <ds-collection-item-mapper> tag must be loaded
100+
cy.get('ds-collection-item-mapper').should('be.visible');
101+
102+
// Analyze entire page for accessibility issues
103+
testA11y('ds-collection-item-mapper');
104+
105+
// Click on the "Map new Items" tab
106+
cy.get('li[data-test="mapTab"] a').click();
107+
108+
// Make sure search form is now visible
109+
cy.get('ds-search-form').should('be.visible');
110+
111+
// Analyze entire page (again) for accessibility issues
112+
testA11y('ds-collection-item-mapper');
113+
});
114+
});
115+
116+
75117
describe('Edit Collection > Delete page', () => {
76118

77119
it('should pass accessibility tests', () => {

src/app/collection-page/collection-item-mapper/collection-item-mapper.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h2>{{'collection.edit.item-mapper.head' | translate}}</h2>
66
<p>{{'collection.edit.item-mapper.description' | translate}}</p>
77

88
<ul ngbNav (navChange)="tabChange($event)" [destroyOnHide]="true" #tabs="ngbNav" class="nav-tabs">
9-
<li [ngbNavItem]="'browseTab'" role="presentation">
9+
<li [ngbNavItem]="'browseTab'" role="presentation" data-test="browseTab">
1010
<a ngbNavLink>{{'collection.edit.item-mapper.tabs.browse' | translate}}</a>
1111
<ng-template ngbNavContent>
1212
<div class="mt-2">
@@ -23,7 +23,7 @@ <h2>{{'collection.edit.item-mapper.head' | translate}}</h2>
2323
</div>
2424
</ng-template>
2525
</li>
26-
<li [ngbNavItem]="'mapTab'" role="presentation">
26+
<li [ngbNavItem]="'mapTab'" role="presentation" data-test="mapTab">
2727
<a ngbNavLink>{{'collection.edit.item-mapper.tabs.map' | translate}}</a>
2828
<ng-template ngbNavContent>
2929
<div class="row mt-2">

src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div *ngVar="(contentSource$ |async) as contentSource">
22
<div class="container-fluid space-children-mr" *ngIf="shouldShow">
3-
<h4>{{ 'collection.source.controls.head' | translate }}</h4>
3+
<h3>{{ 'collection.source.controls.head' | translate }}</h3>
44
<div>
55
<span class="font-weight-bold">{{'collection.source.controls.harvest.status' | translate}}</span>
66
<span>{{contentSource?.harvestStatus}}</span>

src/app/collection-page/edit-collection-page/collection-source/collection-source.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2>{{ 'collection.edit.tabs.source.head' | translate }}</h2>
2626
for="externalSourceCheck">{{ 'collection.edit.tabs.source.external' | translate }}</label>
2727
</div>
2828
<ds-themed-loading *ngIf="!contentSource" [message]="'loading.content-source' | translate"></ds-themed-loading>
29-
<h4 *ngIf="contentSource && (contentSource?.harvestType !== harvestTypeNone)">{{ 'collection.edit.tabs.source.form.head' | translate }}</h4>
29+
<h3 *ngIf="contentSource && (contentSource?.harvestType !== harvestTypeNone)">{{ 'collection.edit.tabs.source.form.head' | translate }}</h3>
3030
</div>
3131
<div class="row">
3232
<ds-form *ngIf="formGroup && contentSource && (contentSource?.harvestType !== harvestTypeNone)"

0 commit comments

Comments
 (0)