From bf685b2461a1c09ae296dbee7ddf38574abc6408 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 28 Sep 2017 14:47:00 +0530 Subject: [PATCH 1/4] =?UTF-8?q?Github=20issue#1175,=20Create=20projects=20?= =?UTF-8?q?as=20Draft=20=E2=80=94=20Reverted=20changes=20to=20now=20have?= =?UTF-8?q?=20separate=20draft=20and=20review=20messages=20from=20coder=20?= =?UTF-8?q?bot.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/constants.js | 5 ++--- src/test/app.test.js | 8 ++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/constants.js b/src/common/constants.js index 4e13b4f..4933723 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -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 Specification 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 support@topcoder.com.`, - 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 ${data.projectName}! 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 Specification section. Get stuck or need help? Email us at support@topcoder.com.`, + title: 'Your project has been submitted for review', + content: data => `Hello, it's Coder again. Thanks for submitting your project ${data.projectName}! 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', diff --git a/src/test/app.test.js b/src/test/app.test.js index e75f18d..50c4e3b 100644 --- a/src/test/app.test.js +++ b/src/test/app.test.js @@ -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 Specification 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 support@topcoder.com.'; + const params = spy.lastCall.args; + assert.equal(params[2], expectedTitle); + assert.equal(params[3], expectedBody); done(); }, testTimeout); }); From 60ecd711d87072f63b297f8894ca2eab75f6e23c Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 28 Sep 2017 15:01:49 +0530 Subject: [PATCH 2/4] =?UTF-8?q?Github=20issue#1175,=20Create=20projects=20?= =?UTF-8?q?as=20Draft=20=E2=80=94=20Fixing=20more=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/app.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/app.test.js b/src/test/app.test.js index 50c4e3b..fec3579 100644 --- a/src/test/app.test.js +++ b/src/test/app.test.js @@ -262,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 test! 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 Specification section. Get stuck or need help? Email us at support@topcoder.com.'; + const expectedTitle = 'Your project has been submitted for review'; + const expectedBody = 'Hello, it\'s Coder again. Thanks for submitting your project test! 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); From 5be5ba66538a4a35940f23f7de3c18776eef5b34 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Mon, 16 Oct 2017 17:11:36 +0530 Subject: [PATCH 3/4] =?UTF-8?q?Github=20issue#1175,=20Create=20projects=20?= =?UTF-8?q?as=20Draft=20=E2=80=94=20deploying=20feature=20branch=20to=20de?= =?UTF-8?q?v?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 8503cee..bf0230b 100644 --- a/circle.yml +++ b/circle.yml @@ -29,7 +29,7 @@ test: deployment: development: - branch: dev + branch: [dev, 'feature/bring-back-draft'] owner: topcoder-platform commands: - docker build -t $DEV_AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_SHA1 . From 929997f883454cfe57e746406d314f31427a1b1c Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Wed, 18 Oct 2017 09:25:24 +0530 Subject: [PATCH 4/4] =?UTF-8?q?Github=20issue#1175,=20Create=20projects=20?= =?UTF-8?q?as=20Draft=20=E2=80=94=20Removed=20temp=20change=20for=20deploy?= =?UTF-8?q?ment=20of=20feature=20branch=20to=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index bf0230b..8503cee 100644 --- a/circle.yml +++ b/circle.yml @@ -29,7 +29,7 @@ test: deployment: development: - branch: [dev, 'feature/bring-back-draft'] + branch: dev owner: topcoder-platform commands: - docker build -t $DEV_AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_SHA1 .