diff --git a/cypress/e2e/group1/checkerWorkflowFromWorkflow.ts b/cypress/e2e/group1/checkerWorkflowFromWorkflow.ts index 7950cb868..dda4cbff2 100644 --- a/cypress/e2e/group1/checkerWorkflowFromWorkflow.ts +++ b/cypress/e2e/group1/checkerWorkflowFromWorkflow.ts @@ -123,7 +123,6 @@ describe('Checker workflow test from my-workflows', () => { cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l'); goToTab('Versions'); - cy.get('[data-cy=date-modified-header]').should('be.visible').click(); cy.wait(1000); //waits for the sorting to finish to ensure Actions button is clicked for the right version (was encountering flakiness) cy.contains('button', 'Actions').click(); diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 5c12545bd..6f03a71e7 100644 --- a/cypress/e2e/group2/myworkflows.ts +++ b/cypress/e2e/group2/myworkflows.ts @@ -337,7 +337,6 @@ describe('Dockstore my workflows part 2', () => { cy.visit('/my-workflows/github.com/A/l'); cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l'); goToTab('Versions'); - cy.get('[data-cy=date-modified-header]').should('be.visible').click(); cy.wait(1000); cy.get('td').contains('Actions').click(); @@ -429,16 +428,15 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=version-DOI-badge]').should('not.exist'); gotoVersionsAndClickActions(); // Request DOI - cy.get('[data-cy=dockstore-request-doi-button]').click(); - cy.get('[data-cy=export-button').should('be.enabled'); - cy.get('[data-cy=export-button').click(); - cy.fixture('versionWithDoi.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', { body: json, statusCode: 200, }).as('getVersionWithDoi'); }); + cy.get('[data-cy=dockstore-request-doi-button]').click(); + cy.get('[data-cy=export-button').should('be.enabled'); + cy.get('[data-cy=export-button').click(); // Should have DOI badges now cy.get('[data-cy=user-DOI-icon]').should('be.visible'); @@ -449,17 +447,16 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=dockstore-request-doi-button').should('not.exist'); // Should not be able to request another DOI // Export to ORCID - cy.get('[data-cy=dockstore-export-orcid-button]').click(); - cy.get('[data-cy=export-button').should('be.enabled'); - cy.get('[data-cy=export-button').click(); cy.fixture('versionAfterOrcidExport.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', { body: json, statusCode: 200, }).as('getVersionAfterOrcidExport'); }); - goToTab('Versions'); - cy.get('td').contains('Actions').click(); + cy.get('[data-cy=dockstore-export-orcid-button]').click(); + cy.get('[data-cy=export-button').should('be.enabled'); + cy.get('[data-cy=export-button').click(); + gotoVersionsAndClickActions(); cy.get('[data-cy=dockstore-export-orcid-button]').should('not.exist'); // Should not be able to export to ORCID again }); }); @@ -504,7 +501,6 @@ describe('Dockstore my workflows part 2', () => { cy.visit('/my-workflows/github.com/A/l'); cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l'); goToTab('Versions'); - cy.get('[data-cy=date-modified-header]').should('be.visible').click(); cy.wait(1000); cy.contains('button', 'Actions').click(); cy.contains('button', 'Refresh Version').should('not.be.disabled'); @@ -661,7 +657,6 @@ describe('Dockstore my workflows part 3', () => { cy.get('#publishButton').should('contain', 'Publish').should('be.visible'); goToTab('Versions'); - cy.get('[data-cy=date-modified-header]').should('be.visible').click(); cy.wait(1000); cy.contains('button', 'Actions').click(); cy.get('[data-cy=set-default-version-button]').should('be.visible').click(); diff --git a/cypress/fixtures/getWorkflowWithDoi.json b/cypress/fixtures/getWorkflowWithDoi.json index 6f6f54d60..6781d7f01 100644 --- a/cypress/fixtures/getWorkflowWithDoi.json +++ b/cypress/fixtures/getWorkflowWithDoi.json @@ -105,6 +105,7 @@ "doiURL": null, "dois": { "USER": { + "id": 1234, "type": "VERSION", "name": "10.5072/zenodo.841014", "initiator": "USER" @@ -137,7 +138,14 @@ "versionEditor": null, "versionMetadata": { "descriptorTypeVersions": [], - "dois": {}, + "dois": { + "USER": { + "id": 1234, + "type": "VERSION", + "name": "10.5072/zenodo.841014", + "initiator": "USER" + } + }, "engineVersions": [], "id": 13, "parsedInformationSet": [], @@ -198,4 +206,4 @@ } ], "workflow_path": "/1st-workflow.cwl" - } \ No newline at end of file + } diff --git a/cypress/fixtures/versionWithDoi.json b/cypress/fixtures/versionWithDoi.json index 1641be232..462f411c5 100644 --- a/cypress/fixtures/versionWithDoi.json +++ b/cypress/fixtures/versionWithDoi.json @@ -19,6 +19,7 @@ "doiURL": null, "dois": { "USER": { + "id": 1234, "type": "VERSION", "name": "10.5072/zenodo.841014", "initiator": "USER" @@ -51,7 +52,14 @@ "versionEditor": null, "versionMetadata": { "descriptorTypeVersions": [], - "dois": {}, + "dois": { + "USER": { + "id": 1234, + "type": "VERSION", + "name": "10.5072/zenodo.841014", + "initiator": "USER" + } + }, "engineVersions": [], "id": 13, "parsedInformationSet": [], diff --git a/src/app/workflow/versions/versions.component.html b/src/app/workflow/versions/versions.component.html index 1dfc97d86..3cc4a9a53 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -21,9 +21,7 @@ [dataSource]="dataSource" class="w-100" matSort - matSortActive="last_modified" - matSortDisableClear - matSortDirection="desc" + matSortStart="asc" [trackBy]="trackBy" > @@ -85,7 +83,7 @@ mat-header-cell *matHeaderCellDef mat-sort-header - disableClear + start="desc" matTooltip="Date of last update to Git reference" matTooltipPosition="above" data-cy="date-modified-header"