diff --git a/gateway/cypress/integration/retention/ui-homepage-edit.js b/gateway/cypress/integration/retention/ui-homepage-edit.js index 70bef107b..9a3637334 100644 --- a/gateway/cypress/integration/retention/ui-homepage-edit.js +++ b/gateway/cypress/integration/retention/ui-homepage-edit.js @@ -5,7 +5,7 @@ import credentials from '../../fixtures/credentials.json'; const { email, name } = data.homepageTestMembers.consortiumMember; describe('Test editing member details', () => { - it('Editing Almonds forest member dtails', function () { + it('Editing Almonds Forest member details', function () { const date = Date.now(); cy.programmaticSignin(email, credentials.password); cy.visit('/'); @@ -61,11 +61,12 @@ describe('Test editing member details', () => { cy.get('app-member-info-landing').contains('Street ' + date + ", City " + date + ", " + date); cy.get('app-member-info-landing').contains(`YES - ORCID can use trademarked assets`); cy.visit('/edit'); + // wait for data to load cy.intercept(`/services/memberservice/api/members/${data.homepageTestMembers.consortiumMember.salesforceId}/member-contacts`).as('details'); cy.wait('@details'); cy.get('[name="trademarkLicense"][value="No"]').click(); + cy.get('[name="website"]').clear() cy.get('[type="submit"]').click(); cy.get('app-member-info-landing').contains(`NO - ORCID cannot use this organization's trademarked name and logos`); - }); }); \ No newline at end of file diff --git a/gateway/cypress/integration/retention/ui-homepage.js b/gateway/cypress/integration/retention/ui-homepage.js index a91b7d43e..513664348 100644 --- a/gateway/cypress/integration/retention/ui-homepage.js +++ b/gateway/cypress/integration/retention/ui-homepage.js @@ -48,7 +48,7 @@ describe('Test homepage', () => { cy.get('.side-bar').contains("Public details") cy.get('.side-bar').contains("Website") cy.get('.side-bar').contains("Email") - cy.get('.side-bar').contains("https://") + cy.get('.side-bar').contains("No website added") cy.get('.side-bar').contains("@orcid.org") cy.get('.main-section').contains("Consortium/Parent organization: Mambo No 5") cy.get('.main-section').contains("Membership: Active") diff --git a/gateway/src/main/webapp/app/home/member-info-landing/member-info-edit/member-info-edit.component.ts b/gateway/src/main/webapp/app/home/member-info-landing/member-info-edit/member-info-edit.component.ts index b55d00344..41f2ffbe8 100644 --- a/gateway/src/main/webapp/app/home/member-info-landing/member-info-edit/member-info-edit.component.ts +++ b/gateway/src/main/webapp/app/home/member-info-landing/member-info-edit/member-info-edit.component.ts @@ -113,7 +113,7 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy { } validateUrl() { - if (!/(http(s?)):\/\//i.test(this.memberData.website)) { + if (this.memberData.website && !/(http(s?)):\/\//i.test(this.memberData.website)) { this.memberData.website = 'http://' + this.memberData.website; } } @@ -184,6 +184,7 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy { this.invalidForm = false; this.isSaving = true; const details: ISFMemberUpdate = this.createDetailsFromForm(); + this.memberService.updateMemberDetails(details, this.memberData.id).subscribe( res => { this.memberService.memberData.next({ diff --git a/gateway/src/main/webapp/app/home/member-info-landing/member-info-landing.component.ts b/gateway/src/main/webapp/app/home/member-info-landing/member-info-landing.component.ts index cc8797815..869cba1aa 100644 --- a/gateway/src/main/webapp/app/home/member-info-landing/member-info-landing.component.ts +++ b/gateway/src/main/webapp/app/home/member-info-landing/member-info-landing.component.ts @@ -35,7 +35,7 @@ export class MemberInfoLandingComponent implements OnInit, OnDestroy { } validateUrl() { - if (!/(http(s?)):\/\//i.test(this.memberData.website)) { + if (this.memberData.website && !/(http(s?)):\/\//i.test(this.memberData.website)) { this.memberData.website = 'http://' + this.memberData.website; } } @@ -71,7 +71,6 @@ export class MemberInfoLandingComponent implements OnInit, OnDestroy { } stopManagingMember() { - // empty string if it's not working this.memberService.setManagedMember(null); this.memberService.fetchMemberData(this.account.salesforceId); }