From 43b750b660227c788b2a16a14ca0f5435dc7bb3b Mon Sep 17 00:00:00 2001 From: Chris Hopkins Date: Wed, 11 Dec 2024 16:34:34 +0000 Subject: [PATCH] test fixes --- src/apps/contacts/services/__test__/form.test.js | 13 ------------- src/apps/contacts/services/form.js | 6 ------ test/end-to-end/cypress/specs/DIT/companies-spec.js | 1 - .../cypress/specs/contacts/create-and-edit-spec.js | 11 ----------- .../cypress/specs/contacts/details-spec.js | 2 -- 5 files changed, 33 deletions(-) diff --git a/src/apps/contacts/services/__test__/form.test.js b/src/apps/contacts/services/__test__/form.test.js index 4b6fca3b033..c7a0a455c64 100644 --- a/src/apps/contacts/services/__test__/form.test.js +++ b/src/apps/contacts/services/__test__/form.test.js @@ -32,7 +32,6 @@ describe('contact form service', () => { primary: true, full_telephone_number: '+1 652423467167', email: 'zboasdaan@opasdasdov.com', - accepts_dit_email_marketing: true, address_same_as_company: false, notes: 'Some notes', archived_by: null, @@ -60,7 +59,6 @@ describe('contact form service', () => { primary: 'yes', full_telephone_number: '+1 652423467167', email: 'zboasdaan@opasdasdov.com', - accepts_dit_email_marketing: true, address_same_as_company: 'no', address_1: '99 N Shore Road', address_2: 'Suite 20', @@ -107,7 +105,6 @@ describe('contact form service', () => { address_postcode: null, address_country: null, notes: 'Some notes', - accepts_dit_email_marketing: true, } const actual = contactFormService.getContactAsFormData(contact) @@ -118,15 +115,5 @@ describe('contact form service', () => { it('should handle a null contact', () => { expect(contactFormService.getContactAsFormData(null)).to.be.null }) - - context('when the contact accepts DBT email marketing', () => { - it('should set the marketing preferences to accepts_dit_email_marketing', () => { - const contact = assign({}, contactData, { - accepts_dit_email_marketing: true, - }) - const actual = contactFormService.getContactAsFormData(contact) - expect(actual.accepts_dit_email_marketing).to.be.true - }) - }) }) }) diff --git a/src/apps/contacts/services/form.js b/src/apps/contacts/services/form.js index dec6765f39f..e4dbe790ba1 100644 --- a/src/apps/contacts/services/form.js +++ b/src/apps/contacts/services/form.js @@ -14,11 +14,6 @@ function getContactAsFormData(contact) { return null } - // default is that people are always marketable, unless opted out - if (!contact.hasOwnProperty('accepts_dit_email_marketing')) { - contact.accepts_dit_email_marketing = true - } - let result = { id: contact.id, company: contact.company.id, @@ -29,7 +24,6 @@ function getContactAsFormData(contact) { primary: contact.primary ? 'yes' : 'no', full_telephone_number: contact.full_telephone_number, email: contact.email, - accepts_dit_email_marketing: contact.accepts_dit_email_marketing, address_same_as_company: contact.address_same_as_company ? 'yes' : 'no', address_1: contact.address_1, address_2: contact.address_2, diff --git a/test/end-to-end/cypress/specs/DIT/companies-spec.js b/test/end-to-end/cypress/specs/DIT/companies-spec.js index 5964b0e8809..f4060a54dbf 100644 --- a/test/end-to-end/cypress/specs/DIT/companies-spec.js +++ b/test/end-to-end/cypress/specs/DIT/companies-spec.js @@ -54,7 +54,6 @@ describe('Contacts', () => { 'Phone number': '44 0778877778800', Address: '100 Path, A town, 12345, United States', Email: 'company.contact@dit.com', - 'Email marketing': 'Cannot be marketed to', }) }) diff --git a/test/functional/cypress/specs/contacts/create-and-edit-spec.js b/test/functional/cypress/specs/contacts/create-and-edit-spec.js index 198e17e5da8..882d84a813f 100644 --- a/test/functional/cypress/specs/contacts/create-and-edit-spec.js +++ b/test/functional/cypress/specs/contacts/create-and-edit-spec.js @@ -45,13 +45,6 @@ const assertRadioGroup = (label, option) => const assertRadioGroupNoOptionChecked = (label) => cy.contains(label).parent().find('input').should('not.be.checked') -const assertNoMarketingConsent = () => - cy - .contains('The company contact does accept email marketing') - .parent() - .find('input') - .should('not.be.checked') - const NEW_CONTACT_ID = '14890695-ce54-4419-88d3-9224754ecbc0' describe('Create contact form', () => { beforeEach(() => { @@ -63,8 +56,6 @@ describe('Create contact form', () => { 'Add contact at Zboncak Group|271eb29e-425b-4cd8-b386-3208c3a5f978': null, }) - assertNoMarketingConsent() - assertRadioGroupNoOptionChecked('Is this person a primary contact?') assertRadioGroupNoOptionChecked( 'Is this contact’s work address the same as the company address?' @@ -316,8 +307,6 @@ describe('Edit contact', () => { `/companies/${ZBONCAK_COMPANY_ID}` ) - assertNoMarketingConsent() - assertRadioGroup('Is this person a primary contact?', 'Yes') assertRadioGroup( 'Is this contact’s work address the same as the company address?', diff --git a/test/functional/cypress/specs/contacts/details-spec.js b/test/functional/cypress/specs/contacts/details-spec.js index 53e48921c83..7137d4d33c5 100644 --- a/test/functional/cypress/specs/contacts/details-spec.js +++ b/test/functional/cypress/specs/contacts/details-spec.js @@ -136,7 +136,6 @@ describe('View contact details', () => { Address: '3 Priory Court, Kingshill Road, Dursley, Gloucestershire, GL11 4DH, United Kingdom', Email: companyAddresscontact.email, - 'Email marketing': EMAIL_CONSENT_NO, }) }) }) @@ -153,7 +152,6 @@ describe('View contact details', () => { '123 Test Boulevard, Basney, US State, 9416875, United States', Email: usContact.email, 'More details': usContact.notes, - 'Email marketing': EMAIL_CONSENT_NO, }) }) })