Skip to content

Commit 02e614b

Browse files
committed
fix: email is null bug
1 parent 84e03cf commit 02e614b

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/Model/SQS/MarketingPreference.model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ export default class MarketingPreference extends Model {
465465
if ((this.getPermissionEmail() !== null
466466
&& this.getPermissionEmail() !== ''
467467
&& this.getPermissionEmail() !== '0')
468-
|| this.getEmail() !== '') {
468+
|| (this.getEmail())) {
469469
if (this.getEmail()) {
470470
requestConstraintsClone.email = { email: true };
471471
} else {

tests/unit/Model/SQS/MarketingPreferences.model.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,27 +239,27 @@ describe('Model/MarketingPreferencesModel', () => {
239239

240240
describe('Ensure validation passes when permissions are not set', () => {
241241
const mockedData = {
242-
firstname: 'Tim',
243-
lastname: 'Jones',
242+
firstname: 'Kelvin',
243+
lastname: 'James',
244244
phone: '0208 254 3062',
245-
mobile: '07917 321 492',
246-
address1: '32-36',
247-
address2: 'St. Smith\'s Avenue',
248-
address3: '',
249-
town: 'London',
250-
postcode: 'sw184bx',
251-
country: 'United Kindgom',
252-
campaign: 'sr18',
245+
mobile: '07425253522',
246+
address1: 'COMIC RELIEF',
247+
address2: 'CAMELFORD HOUSE 87-90',
248+
address3: 'ALBERT EMBANKMENT',
249+
town: 'LONDON',
250+
postcode: 'SE1 7TP',
251+
country: 'GB',
252+
campaign: 'RND19',
253253
transactionId: 'AN129MNDJDJ',
254-
transSource: 'giftaid-sportrelief',
254+
transSource: 'RND19_GiftAid',
255255
transSourceUrl: 'https://giftaid.sportrelief.com/',
256256
transType: 'prefs',
257-
email: '',
258-
permissionEmail: '',
259-
permissionPost: '',
260-
permissionPhone: '',
261-
permissionSMS: '',
262-
timestamp: '1550841771',
257+
confirm: 1,
258+
permissionEmail: null,
259+
permissionPost: null,
260+
permissionPhone: null,
261+
permissionSMS: null,
262+
timestamp: '1562165588',
263263
};
264264

265265
const model = new MarketingPreferencesModel(mockedData);

0 commit comments

Comments
 (0)