diff --git a/cypress/e2e/item-edit.cy.ts b/cypress/e2e/item-edit.cy.ts index 25c63bea81c..604aab9d042 100644 --- a/cypress/e2e/item-edit.cy.ts +++ b/cypress/e2e/item-edit.cy.ts @@ -15,14 +15,12 @@ describe('Edit Item > Edit Metadata tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="metadata"]').click(); + // Our selected tab should be active + cy.get('a[data-test="metadata"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-edit-item-page').should('be.visible'); - // wait for all the Edit Item tabs to be rendered - cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLDivElement) => { - cy.wrap($row).find('li[role="presentation"]').should('be.visible'); - }); - // wait for all the ds-dso-edit-metadata-value components to be rendered cy.get('ds-dso-edit-metadata-value div[role="row"]').each(($row: HTMLDivElement) => { cy.wrap($row).find('div[role="cell"]').should('be.visible'); @@ -38,6 +36,9 @@ describe('Edit Item > Status tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="status"]').click(); + // Our selected tab should be active + cy.get('a[data-test="status"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-status').should('be.visible'); @@ -51,6 +52,9 @@ describe('Edit Item > Bitstreams tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="bitstreams"]').click(); + // Our selected tab should be active + cy.get('a[data-test="bitstreams"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-bitstreams').should('be.visible'); @@ -75,6 +79,9 @@ describe('Edit Item > Curate tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="curate"]').click(); + // Our selected tab should be active + cy.get('a[data-test="curate"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-curate').should('be.visible'); @@ -88,6 +95,9 @@ describe('Edit Item > Relationships tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="relationships"]').click(); + // Our selected tab should be active + cy.get('a[data-test="relationships"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-relationships').should('be.visible'); @@ -101,6 +111,9 @@ describe('Edit Item > Version History tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="versionhistory"]').click(); + // Our selected tab should be active + cy.get('a[data-test="versionhistory"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-version-history').should('be.visible'); @@ -114,6 +127,9 @@ describe('Edit Item > Access Control tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="access-control"]').click(); + // Our selected tab should be active + cy.get('a[data-test="access-control"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-access-control').should('be.visible'); @@ -127,6 +143,9 @@ describe('Edit Item > Collection Mapper tab', () => { it('should pass accessibility tests', () => { cy.get('a[data-test="mapper"]').click(); + // Our selected tab should be active + cy.get('a[data-test="mapper"]').should('have.class', 'active'); + // tag must be loaded cy.get('ds-item-collection-mapper').should('be.visible');