Skip to content

Commit

Permalink
Merge remote-tracking branch 'biomage/master' into biomage-changes-4
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvpickering committed May 23, 2023
2 parents c353292 + 7f94a23 commit 2666eb7
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/utils/emailTemplates/buildPipelineStatusEmailBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const buildPipelineStatusEmailBody = (experimentId, status, user) => {
Data: 'Cellenics experiment status',
},
},
Source: isHMS ? '[email protected]' : 'notification@biomage.net',
Source: isHMS ? '[email protected]' : `notification@${process.env.DOMAIN_NAME}`,
};
return params;
};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/emailTemplates/buildUserInvitedEmailBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const buildUserInvitedEmailBody = (email, experimentId, inviterUser) => {
Data: 'Invitation to join a project in Cellenics',
},
},
Source: isHMS ? '[email protected]' : 'notification@biomage.net',
Source: isHMS ? '[email protected]' : `notification@${process.env.DOMAIN_NAME}`,
};
return params;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const buildUserInvitedNotRegisteredEmailBody = (email, inviterUser) => {
Data: 'Invitation to join a project in Cellenics',
},
},
Source: isHMS ? '[email protected]' : 'notification@biomage.net',
Source: isHMS ? '[email protected]' : `notification@${process.env.DOMAIN_NAME}`,
};
return params;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Object {
"Data": "Invitation to join a project in Cellenics",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
Expand Down Expand Up @@ -124,6 +124,6 @@ Object {
"Data": "Invitation to join a project in Cellenics",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
2 changes: 2 additions & 0 deletions tests/api.v2/helpers/access/createUserInvite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const mockInvitedUserEmail = '[email protected]';
const mockInviterUser = { email: '[email protected]' };
const mockRole = AccessRole.EXPLORER;

process.env.DOMAIN_NAME = 'localhost.test';

describe('creatUserInvite', () => {
beforeEach(async () => {
jest.clearAllMocks();
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/__snapshots__/sendEmail.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Array [
"Data": "Cellenics experiment status",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
},
[Function],
],
Expand Down Expand Up @@ -127,7 +127,7 @@ Array [
"Data": "Cellenics experiment status",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
},
[Function],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Object {
"Data": "Cellenics experiment status",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
Expand Down Expand Up @@ -120,7 +120,7 @@ Object {
"Data": "Cellenics experiment status",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Object {
"Data": "Invitation to join a project in Cellenics",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Object {
"Data": "Invitation to join a project in Cellenics",
},
},
"Source": "notification@biomage.net",
"Source": "notification@localhost.test",
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const mockUser = {
email: '[email protected]',
};

process.env.DOMAIN_NAME = 'localhost.test';

describe('buildUserInvitedNotRegisteredEmailBody', () => {
it('Should build the correct message for SUCCEEDED status', () => {
const emailParams = buildPipelineStatusEmailBody(mockExperimentId, SUCCEEDED, mockUser);
Expand Down
2 changes: 2 additions & 0 deletions tests/utils/emailTemplates/buildUserInvitedEmailBody.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const testUserEmail = '[email protected]';
const mockInviterUser = { email: '[email protected]' };
const mockExperimentId = 'mock-experiment-id';

process.env.DOMAIN_NAME = 'localhost.test';

describe('buildUserInvitedEmailBody', () => {
it('Should build the correct message', () => {
const emailParams = buildUserInvitedEmailBody(testUserEmail, mockExperimentId, mockInviterUser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const buildUserInvitedNotRegisteredEmailBody = require('../../../src/utils/email
const testUserEmail = '[email protected]';
const mockInviterUser = { email: '[email protected]' };

process.env.DOMAIN_NAME = 'localhost.test';

describe('buildUserInvitedNotRegisteredEmailBody', () => {
it('Should build the correct message', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/utils/sendEmail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const { SUCCEEDED, FAILED } = require('../../src/api.v2/constants');
const { USER } = require('../test-utils/constants');
const buildPipelineStatusEmailBody = require('../../src/utils/emailTemplates/buildPipelineStatusEmailBody');

process.env.DOMAIN_NAME = 'localhost.test';

describe('sending email works', () => {
const experimentId = 'other-id';
let sendEmailSpy;
Expand Down

0 comments on commit 2666eb7

Please sign in to comment.