From 8eae00ed064388fc6eba9740d7949acb51ced853 Mon Sep 17 00:00:00 2001 From: Emily Soth <43770515+emlys@users.noreply.github.com> Date: Wed, 24 Jun 2020 10:02:02 -0700 Subject: [PATCH] Feature/reinstate tool tests (#1020) --- cypress/integration/manualTests/auth-tests.ts | 44 +++++++++---------- .../organization-starring.service.ts | 5 ++- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/cypress/integration/manualTests/auth-tests.ts b/cypress/integration/manualTests/auth-tests.ts index ca4d0c0f86..dacea65e7b 100644 --- a/cypress/integration/manualTests/auth-tests.ts +++ b/cypress/integration/manualTests/auth-tests.ts @@ -22,6 +22,7 @@ function unpublishTool() { function deleteTool() { it('delete the tool', () => { + cy.wait(1000); cy.contains('button', 'Delete').should('be.visible'); cy.contains('button', 'Delete').click(); cy.contains('div', 'Are you sure you wish to delete this tool?').within(() => { @@ -46,25 +47,23 @@ function registerQuayTool(repo: string, name: string) { cy.visit('/my-tools'); // click thru the steps of registering a tool cy.wait('@tokens'); - - // Commented out until tool delete issue is fixed - // See https://github.com/dockstore/dockstore/pull/3494/files - // tool will already be there, so no need to register it - // - // cy.get('#register_tool_button').should('be.visible'); - // - // cy.get('#register_tool_button').click(); - // cy.get('mat-dialog-content').within(() => { - // cy.wait('@orgs'); - // cy.contains('mat-radio-button', 'Quickly register Quay.io tools').click(); - // cy.contains('button', 'Next').click(); - // cy.contains('mat-form-field', 'Select namespace').click(); - // }); - // cy.contains('mat-option', repo).click(); - // cy.wait('@repos'); - // cy.contains('mat-icon', 'sync').click(); - // cy.wait('@containers'); - // cy.contains('button', 'Finish').click(); + cy.get('#register_tool_button').should('be.visible'); + cy.get('#register_tool_button').click(); + cy.get('mat-dialog-content').within(() => { + cy.wait('@orgs'); + cy.contains('mat-radio-button', 'Quickly register Quay.io tools').click(); + cy.contains('button', 'Next').click(); + cy.contains('mat-form-field', 'Select namespace').click(); + }); + cy.contains('mat-option', repo).click(); + cy.wait('@repos'); + cy.get('mat-dialog-content').within(() => { + cy.contains('div', name).within(() => { + cy.contains('mat-icon', 'sync').click(); + }); + }); + cy.wait('@containers'); + cy.contains('button', 'Finish').click(); cy.contains('button', 'Publish').click(); cy.wait('@publish'); cy.wait('@containers'); @@ -253,13 +252,10 @@ function testCollection(org: string, collection: string, registry: string, repo: cy.visit('/my-tools'); }); unpublishTool(); + deleteTool(); }); } testCollection(collectionTuple[0], collectionTuple[1], toolTuple[0], toolTuple[1], toolTuple[2]); - -// Commented out until tool delete fix is merged -// See https://github.com/dockstore/dockstore/pull/3494/files -// testTool(toolTuple[0], toolTuple[1], toolTuple[2]); - +testTool(toolTuple[0], toolTuple[1], toolTuple[2]); testWorkflow(workflowTuple[0], workflowTuple[1], workflowTuple[2]); diff --git a/src/app/organizations/organization/organization-starring/organization-starring.service.ts b/src/app/organizations/organization/organization-starring/organization-starring.service.ts index 6950cb0626..34839b1e31 100644 --- a/src/app/organizations/organization/organization-starring/organization-starring.service.ts +++ b/src/app/organizations/organization/organization-starring/organization-starring.service.ts @@ -27,7 +27,10 @@ export class OrganizationStarringService { constructor(private usersService: UsersService, private organizationsService: OrganizationsService) {} setUnstar(organizationID: number): Observable { - return this.organizationsService.unstarOrganization(organizationID); + const body: StarRequest = { + star: false + }; + return this.organizationsService.starOrganization(organizationID, body); } setStar(organizationID: number): Observable {