Skip to content

Commit dde029d

Browse files
committed
Ensure Item Edit page tab is visible before & after clicking it.
1 parent b0924b5 commit dde029d

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

cypress/e2e/item-edit.cy.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ beforeEach(() => {
1313

1414
describe('Edit Item > Edit Metadata tab', () => {
1515
it('should pass accessibility tests', () => {
16+
cy.get('a[data-test="metadata"]').should('be.visible');
1617
cy.get('a[data-test="metadata"]').click();
1718

18-
// Our selected tab should be active
19+
// Our selected tab should be both visible & active
20+
cy.get('a[data-test="metadata"]').should('be.visible');
1921
cy.get('a[data-test="metadata"]').should('have.class', 'active');
2022

2123
// <ds-edit-item-page> tag must be loaded
@@ -34,9 +36,11 @@ describe('Edit Item > Edit Metadata tab', () => {
3436
describe('Edit Item > Status tab', () => {
3537

3638
it('should pass accessibility tests', () => {
39+
cy.get('a[data-test="status"]').should('be.visible');
3740
cy.get('a[data-test="status"]').click();
3841

39-
// Our selected tab should be active
42+
// Our selected tab should be both visible & active
43+
cy.get('a[data-test="status"]').should('be.visible');
4044
cy.get('a[data-test="status"]').should('have.class', 'active');
4145

4246
// <ds-item-status> tag must be loaded
@@ -50,9 +54,11 @@ describe('Edit Item > Status tab', () => {
5054
describe('Edit Item > Bitstreams tab', () => {
5155

5256
it('should pass accessibility tests', () => {
57+
cy.get('a[data-test="bitstreams"]').should('be.visible');
5358
cy.get('a[data-test="bitstreams"]').click();
5459

55-
// Our selected tab should be active
60+
// Our selected tab should be both visible & active
61+
cy.get('a[data-test="bitstreams"]').should('be.visible');
5662
cy.get('a[data-test="bitstreams"]').should('have.class', 'active');
5763

5864
// <ds-item-bitstreams> tag must be loaded
@@ -77,9 +83,11 @@ describe('Edit Item > Bitstreams tab', () => {
7783
describe('Edit Item > Curate tab', () => {
7884

7985
it('should pass accessibility tests', () => {
86+
cy.get('a[data-test="curate"]').should('be.visible');
8087
cy.get('a[data-test="curate"]').click();
8188

82-
// Our selected tab should be active
89+
// Our selected tab should be both visible & active
90+
cy.get('a[data-test="curate"]').should('be.visible');
8391
cy.get('a[data-test="curate"]').should('have.class', 'active');
8492

8593
// <ds-item-curate> tag must be loaded
@@ -93,9 +101,11 @@ describe('Edit Item > Curate tab', () => {
93101
describe('Edit Item > Relationships tab', () => {
94102

95103
it('should pass accessibility tests', () => {
104+
cy.get('a[data-test="relationships"]').should('be.visible');
96105
cy.get('a[data-test="relationships"]').click();
97106

98-
// Our selected tab should be active
107+
// Our selected tab should be both visible & active
108+
cy.get('a[data-test="relationships"]').should('be.visible');
99109
cy.get('a[data-test="relationships"]').should('have.class', 'active');
100110

101111
// <ds-item-relationships> tag must be loaded
@@ -109,9 +119,11 @@ describe('Edit Item > Relationships tab', () => {
109119
describe('Edit Item > Version History tab', () => {
110120

111121
it('should pass accessibility tests', () => {
122+
cy.get('a[data-test="versionhistory"]').should('be.visible');
112123
cy.get('a[data-test="versionhistory"]').click();
113124

114-
// Our selected tab should be active
125+
// Our selected tab should be both visible & active
126+
cy.get('a[data-test="versionhistory"]').should('be.visible');
115127
cy.get('a[data-test="versionhistory"]').should('have.class', 'active');
116128

117129
// <ds-item-version-history> tag must be loaded
@@ -125,9 +137,11 @@ describe('Edit Item > Version History tab', () => {
125137
describe('Edit Item > Access Control tab', () => {
126138

127139
it('should pass accessibility tests', () => {
140+
cy.get('a[data-test="access-control"]').should('be.visible');
128141
cy.get('a[data-test="access-control"]').click();
129142

130-
// Our selected tab should be active
143+
// Our selected tab should be both visible & active
144+
cy.get('a[data-test="access-control"]').should('be.visible');
131145
cy.get('a[data-test="access-control"]').should('have.class', 'active');
132146

133147
// <ds-item-access-control> tag must be loaded
@@ -141,9 +155,11 @@ describe('Edit Item > Access Control tab', () => {
141155
describe('Edit Item > Collection Mapper tab', () => {
142156

143157
it('should pass accessibility tests', () => {
158+
cy.get('a[data-test="mapper"]').should('be.visible');
144159
cy.get('a[data-test="mapper"]').click();
145160

146-
// Our selected tab should be active
161+
// Our selected tab should be both visible & active
162+
cy.get('a[data-test="mapper"]').should('be.visible');
147163
cy.get('a[data-test="mapper"]').should('have.class', 'active');
148164

149165
// <ds-item-collection-mapper> tag must be loaded

0 commit comments

Comments
 (0)