Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

bring back draft #73

Merged
merged 4 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ module.exports = {
created: {
title: 'Your project has been created, and we\'re ready for your specification',
content: data => `Hello, Coder here! Your project '${data.projectName}' has been created successfully. For your next step, please head over to the <a href="${data.projectUrl}specification/" rel="nofollow">Specification</a> section and answer all of the required questions. If you already have a document with your requirements, just verify it against our checklist and then upload it. Once you're done, hit the "Submit for Review" button on the Specification. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.`,
disabled: true,
},
submittedForReview: {
title: 'Your project is being reviewed. Provide additional info if you have it.',
content: data => `Hello, Coder here! Thanks for submitting your project <a href="${data.projectUrl}" rel="nofollow">${data.projectName}</a>! I've used my super computational powers to route it to one of our trusty humans. They'll get back to you in 1-2 business days. Meanwhile, if have any additional project information or documents to upload, please head over to the <a href="${data.projectUrl}specification/" rel="nofollow">Specification</a> section. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.`,
title: 'Your project has been submitted for review',
content: data => `Hello, it's Coder again. Thanks for submitting your project <a href="${data.projectUrl}" rel="nofollow">${data.projectName}</a>! I've used my super computational powers to route it to one of our trusty humans. They'll get back to you in 1-2 business days.`,
},
activated: {
title: 'Work on your project has begun',
Expand Down
12 changes: 8 additions & 4 deletions src/test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,14 @@ describe('app', () => {
});

describe('`project.draft-created` event', () => {
it('should not create `Project.Created` notification as it is disabled now', (done) => {
it('should create `Project.Created` notification', (done) => {
sendTestEvent(sampleEvents.draftCreated, 'project.draft-created');
setTimeout(() => {
sinon.assert.notCalled(spy);
const expectedTitle = 'Your project has been created, and we\'re ready for your specification';
const expectedBody = 'Hello, Coder here! Your project \'test\' has been created successfully. For your next step, please head over to the <a href="https://connect.topcoder-dev.com/projects/1/specification/" rel="nofollow">Specification</a> section and answer all of the required questions. If you already have a document with your requirements, just verify it against our checklist and then upload it. Once you\'re done, hit the "Submit for Review" button on the Specification. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.';
const params = spy.lastCall.args;
assert.equal(params[2], expectedTitle);
assert.equal(params[3], expectedBody);
done();
}, testTimeout);
});
Expand All @@ -258,8 +262,8 @@ describe('app', () => {
sendTestEvent(sampleEvents.updatedInReview, 'project.updated');
setTimeout(() => {
assertCount += 1;
const expectedTitle = 'Your project is being reviewed. Provide additional info if you have it.';
const expectedBody = 'Hello, Coder here! Thanks for submitting your project <a href="https://connect.topcoder-dev.com/projects/1/" rel="nofollow">test</a>! I\'ve used my super computational powers to route it to one of our trusty humans. They\'ll get back to you in 1-2 business days. Meanwhile, if have any additional project information or documents to upload, please head over to the <a href="https://connect.topcoder-dev.com/projects/1/specification/" rel="nofollow">Specification</a> section. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.';
const expectedTitle = 'Your project has been submitted for review';
const expectedBody = 'Hello, it\'s Coder again. Thanks for submitting your project <a href="https://connect.topcoder-dev.com/projects/1/" rel="nofollow">test</a>! I\'ve used my super computational powers to route it to one of our trusty humans. They\'ll get back to you in 1-2 business days.';
let params = spy.lastCall.args;
assert.equal(params[2], expectedTitle);
assert.equal(params[3], expectedBody);
Expand Down