Skip to content

Commit

Permalink
use webservice-defined sort ordering in workflow versions table by de…
Browse files Browse the repository at this point in the history
  • Loading branch information
svonworl authored Dec 20, 2024
1 parent a6307f9 commit 3396570
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/group1/checkerWorkflowFromWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
23 changes: 9 additions & 14 deletions cypress/e2e/group2/myworkflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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');
Expand All @@ -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
});
});
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 10 additions & 2 deletions cypress/fixtures/getWorkflowWithDoi.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"doiURL": null,
"dois": {
"USER": {
"id": 1234,
"type": "VERSION",
"name": "10.5072/zenodo.841014",
"initiator": "USER"
Expand Down Expand Up @@ -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": [],
Expand Down Expand Up @@ -198,4 +206,4 @@
}
],
"workflow_path": "/1st-workflow.cwl"
}
}
10 changes: 9 additions & 1 deletion cypress/fixtures/versionWithDoi.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"doiURL": null,
"dois": {
"USER": {
"id": 1234,
"type": "VERSION",
"name": "10.5072/zenodo.841014",
"initiator": "USER"
Expand Down Expand Up @@ -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": [],
Expand Down
6 changes: 2 additions & 4 deletions src/app/workflow/versions/versions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[dataSource]="dataSource"
class="w-100"
matSort
matSortActive="last_modified"
matSortDisableClear
matSortDirection="desc"
matSortStart="asc"
[trackBy]="trackBy"
>
<ng-container matColumnDef="name">
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3396570

Please sign in to comment.