From 3d6457ba1f6b7567e0d585d2e27bed1f05ca7642 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Mon, 28 Nov 2016 20:52:49 -0800 Subject: [PATCH] Rename to thank-you; update BEM; update tests --- app/components/thank-you-container.js | 9 +++ app/components/thankyou-container.js | 17 ------ app/controllers/project/donate.js | 2 +- app/router.js | 2 +- .../project/{thankyou.js => thank-you.js} | 0 app/styles/app.scss | 2 +- app/styles/templates/project/thank-you.scss | 29 ++++++++++ app/styles/templates/project/thankyou.scss | 27 --------- .../components/thank-you-container.hbs | 10 ++++ .../components/thankyou-container.hbs | 4 -- app/templates/project/thank-you.hbs | 2 + app/templates/project/thankyou.hbs | 2 - .../assets/images/icons/fireworks-large.png | Bin 0 -> 6819 bytes .../images/icons/fireworks-large@2x.png | Bin 0 -> 14402 bytes tests/acceptance/project-donate-test.js | 2 +- tests/acceptance/project-thank-you-test.js | 49 +++++++++++++++++ tests/acceptance/project-thankyou-test.js | 52 ------------------ .../components/thank-you-container-test.js | 25 +++++++++ .../components/thankyou-container-test.js | 36 ------------ ...ou-container.js => thank-you-container.js} | 10 ++-- tests/pages/project/thank-you.js | 8 +++ tests/pages/project/thankyou.js | 12 ---- tests/unit/routes/project/thankyou-test.js | 10 ---- 23 files changed, 142 insertions(+), 168 deletions(-) create mode 100644 app/components/thank-you-container.js delete mode 100644 app/components/thankyou-container.js rename app/routes/project/{thankyou.js => thank-you.js} (100%) create mode 100644 app/styles/templates/project/thank-you.scss delete mode 100644 app/styles/templates/project/thankyou.scss create mode 100644 app/templates/components/thank-you-container.hbs delete mode 100644 app/templates/components/thankyou-container.hbs create mode 100644 app/templates/project/thank-you.hbs delete mode 100644 app/templates/project/thankyou.hbs create mode 100644 public/assets/images/icons/fireworks-large.png create mode 100644 public/assets/images/icons/fireworks-large@2x.png create mode 100644 tests/acceptance/project-thank-you-test.js delete mode 100644 tests/acceptance/project-thankyou-test.js create mode 100644 tests/integration/components/thank-you-container-test.js delete mode 100644 tests/integration/components/thankyou-container-test.js rename tests/pages/components/{thankyou-container.js => thank-you-container.js} (54%) create mode 100644 tests/pages/project/thank-you.js delete mode 100644 tests/pages/project/thankyou.js delete mode 100644 tests/unit/routes/project/thankyou-test.js diff --git a/app/components/thank-you-container.js b/app/components/thank-you-container.js new file mode 100644 index 000000000..5b5c9d24e --- /dev/null +++ b/app/components/thank-you-container.js @@ -0,0 +1,9 @@ +import Ember from 'ember'; + +const { + Component +} = Ember; + +export default Component.extend({ + classNames: ['thank-you-container'] +}); diff --git a/app/components/thankyou-container.js b/app/components/thankyou-container.js deleted file mode 100644 index bfe24556a..000000000 --- a/app/components/thankyou-container.js +++ /dev/null @@ -1,17 +0,0 @@ -import Ember from 'ember'; - -const { - Component, - computed, - get -} = Ember; - -export default Component.extend({ - classNames: ['thankyou-container'], - - projectIconAltText: computed('project.title', function() { - let projectTitle = get(this, 'project.title'); - - return `Successfully donated to ${projectTitle}`; - }) -}); diff --git a/app/controllers/project/donate.js b/app/controllers/project/donate.js index 05508a766..c94443ca3 100644 --- a/app/controllers/project/donate.js +++ b/app/controllers/project/donate.js @@ -96,7 +96,7 @@ export default Controller.extend({ _transitionToThankYou() { let project = get(this, 'project'); - return this.transitionToRoute('project.thankyou', project); + return this.transitionToRoute('project.thank-you', project); }, _handleError(error) { diff --git a/app/router.js b/app/router.js index d69dc6864..5642a3709 100644 --- a/app/router.js +++ b/app/router.js @@ -57,7 +57,7 @@ AppRouter.map(function() { this.route('task', { path: '/:number' }); }); this.route('donate'); - this.route('thankyou'); + this.route('thank-you'); }); this.route('projects', { diff --git a/app/routes/project/thankyou.js b/app/routes/project/thank-you.js similarity index 100% rename from app/routes/project/thankyou.js rename to app/routes/project/thank-you.js diff --git a/app/styles/app.scss b/app/styles/app.scss index 76e3fbae1..ad46df950 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -83,7 +83,7 @@ @import "templates/about"; @import "templates/oauth-stripe"; @import "templates/project/index"; -@import "templates/project/thankyou"; +@import "templates/project/thank-you"; @import "templates/project/settings/contributors"; @import "templates/start/expertise"; @import "templates/start/hello"; diff --git a/app/styles/templates/project/thank-you.scss b/app/styles/templates/project/thank-you.scss new file mode 100644 index 000000000..c56f20110 --- /dev/null +++ b/app/styles/templates/project/thank-you.scss @@ -0,0 +1,29 @@ +.thank-you-container { + margin: 3em; + text-align: center; + + &__project-icon { + $file: "/assets/images/icons/fireworks-large"; + $height: 100px; + $width: 100px; + @include background-image-retina($file, "png", $height, $width); + display: block; + height: $height; + margin: 1.4em auto; + width: $width; + } + + h3 { + font-size: $header-font-size-large; + font-weight: 600; + margin: 10px 0; + } + + p { + margin-bottom: 1.4em; + } + + &__message { + color: $light-text; + } +} diff --git a/app/styles/templates/project/thankyou.scss b/app/styles/templates/project/thankyou.scss deleted file mode 100644 index 9da2ea1f9..000000000 --- a/app/styles/templates/project/thankyou.scss +++ /dev/null @@ -1,27 +0,0 @@ -.thankyou-container { - .icon, .header, .text, .project-link { - width: 100%; - text-align: center; - } - - .header, .text { - margin-bottom: 20px; - } - - .header { - font-size: 1.5em; - margin-top: 0px; - } - - .icon { - img { - display: inline-block; - } - margin-bottom: 0px; - } - - .text { - color: $light-text; - font-size: 14px; - } -} diff --git a/app/templates/components/thank-you-container.hbs b/app/templates/components/thank-you-container.hbs new file mode 100644 index 000000000..d6d26f8aa --- /dev/null +++ b/app/templates/components/thank-you-container.hbs @@ -0,0 +1,10 @@ +
+

Thank you!

+
+

+ From all the volunteers on the {{project.title}} team. +

+

+ {{link-to "Back to project" "project" project.organization.slug project.slug}} +

+
diff --git a/app/templates/components/thankyou-container.hbs b/app/templates/components/thankyou-container.hbs deleted file mode 100644 index b508d65d9..000000000 --- a/app/templates/components/thankyou-container.hbs +++ /dev/null @@ -1,4 +0,0 @@ -
{{projectIconAltText}}
-

Thank you!

-
From all the volunteers on the {{project.title}} team.
- diff --git a/app/templates/project/thank-you.hbs b/app/templates/project/thank-you.hbs new file mode 100644 index 000000000..d88b26c2c --- /dev/null +++ b/app/templates/project/thank-you.hbs @@ -0,0 +1,2 @@ +{{project-header project=model}} +{{thank-you-container project=model}} diff --git a/app/templates/project/thankyou.hbs b/app/templates/project/thankyou.hbs deleted file mode 100644 index 60974a3ce..000000000 --- a/app/templates/project/thankyou.hbs +++ /dev/null @@ -1,2 +0,0 @@ -{{project-header project=model}} -{{thankyou-container project=model}} diff --git a/public/assets/images/icons/fireworks-large.png b/public/assets/images/icons/fireworks-large.png new file mode 100644 index 0000000000000000000000000000000000000000..63b940b42702324a14384669dfe281365943b8bf GIT binary patch literal 6819 zcmV;U8eHXxP)2pT*8A%wH@QpQ z+uiAOci#6=-YP)j>fR>gbT~Z%r$-=pdu)|Um{({a26UjR zl7%OZsZU|XFHZDIFC4p(R@mqP=uyBrRWtPom8tg;#$+Q6m=iySNMvtgU(g#yQt|gL z7_gdB@->)q57H@mTbV?*>d*0vZ7W1dl-C*?gaJJRf4{A(SIaxB3asu_$i^7)Tt`$x zJb~r`D>FEqEX(m@NN2Lo*jD}wCQQUcTVP}chhrc<=W)D)P*3<)D%<%AacUeT^gCo+ z$SAuS9lOzqj>Bb-JnYnD`kfn1G;vrFN6^M@ZgpVAFxr9ipo7Q}H@aBh>>>-bVz57h zOm$=kBkVljUxsWB8mL6#w?Z0Q#|PP!A?QbOdte4{u1#cVeV}Zu7DxJz(!fJElEaY} z)0+HP6&__1c?EH1(ELnP=^ReJwxo4bWWEA+IZ>6hkyb`2Jtk2p z=Tr{;DAKaR&5yxNAX~^VD6wgLsM6pd| zbuD0BSU_FVX3XHVGUkD!@ddbGUKsNk6YhOPjcY3y%_Q}3jVv*i2hsLKdt(M~pJ{~* zE@0krrhI^9e1);`ZTd{fM?SBd1Hag@HZ3XVZ$_(B;Mt)V-pnl!CfMv8rZ{aqd&32IFU}e$s$S%-)$mzh4+3k@TTHE+P z9y+X4=D|$OZA?Y~Kc?x=a1>0aokG8AZEfs(lCCyD2@|ppBIz|rBL5^Fve{{{wKETi zTm+^4YHRC^c0O%|@N?GtC_d6%S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ac}D{QwqfE>n_{3mIr zcGN=#!n~=)czPS%g<3o=YfF`o^8mOM>=Jnxzg!|*T2T$Af%9q82^2GK1^9Sx>I?+@&;7?Ztd`bB5 zO^3;oMU(Nn@Ic8w0(b(nL`3$ptg40|noCqfB~2)aiD8~=(ZPC0bAr|~dgoEN=NY#_ zpK3l9&D%0ixzz{j1oIhmwt=}*)Q4A2ehR{JV|ZapVE6!K|BL2aLJ7HK)9%Hto<)nQ zj+kbJAm)*ZCwuIL0K1gyB{CsSuPt@agr#tUj|sWi7?DHg!KY;>Sv5AkYyEH0g}LAR zX_|d&PQbfhI9| zn|FoY1EKDn(F!^FgjU6H=)}C;;OQbs2S>UHQ!}%H9xi`9%P&(2{2wFap+D`fbIFnB vm2HprU0|t<^bgSgH(mF?=k4q$uD{Ox;=QQX(mehR1p*{R9a# literal 0 HcmV?d00001 diff --git a/tests/acceptance/project-donate-test.js b/tests/acceptance/project-donate-test.js index a2aa47e3a..a4bb0ee02 100644 --- a/tests/acceptance/project-donate-test.js +++ b/tests/acceptance/project-donate-test.js @@ -128,7 +128,7 @@ test('Allows adding a card and donating (creating a subscription)', function(ass assert.ok(subscription, 'Subscription was created sucessfully.'); assert.equal(subscription.userId, user.id, 'User was set to current user.'); assert.equal(subscription.projectId, project.id, 'Project was set to current project.'); - assert.equal(currentRouteName(), 'project.thankyou', 'User was redirected to the thank you route.'); + assert.equal(currentRouteName(), 'project.thank-you', 'User was redirected to the thank you route.'); }); }); diff --git a/tests/acceptance/project-thank-you-test.js b/tests/acceptance/project-thank-you-test.js new file mode 100644 index 000000000..b06d81927 --- /dev/null +++ b/tests/acceptance/project-thank-you-test.js @@ -0,0 +1,49 @@ +import { test } from 'qunit'; +import moduleForAcceptance from 'code-corps-ember/tests/helpers/module-for-acceptance'; + +import { authenticateSession } from 'code-corps-ember/tests/helpers/ember-simple-auth'; +import createProjectWithSluggedRoute from 'code-corps-ember/tests/helpers/mirage/create-project-with-slugged-route'; +import projectThankYouPage from '../pages/project/thank-you'; + +moduleForAcceptance('Acceptance | Project - thank-you'); + +test('It requires authentication', function(assert) { + assert.expect(1); + + let project = createProjectWithSluggedRoute(); + let { organization } = project; + + projectThankYouPage.visit({ + organization: organization.slug, + project: project.slug + }); + + andThen(() => { + assert.equal(currentRouteName(), 'login'); + }); +}); + +test('It directs you to the project when done', function(assert) { + assert.expect(2); + + let user = server.create('user'); + authenticateSession(this.application, { 'user_id': user.id }); + + let project = createProjectWithSluggedRoute(); + let { organization } = project; + + projectThankYouPage.visit({ + organization: organization.slug, + project: project.slug + }); + + andThen(() => { + assert.ok(projectThankYouPage.thankYouContainer.isVisible, 'The thank you container component renders.'); + + projectThankYouPage.thankYouContainer.clickLink(); + }); + + andThen(() => { + assert.equal(currentRouteName(), 'project.index', 'Link leads to project page.'); + }); +}); diff --git a/tests/acceptance/project-thankyou-test.js b/tests/acceptance/project-thankyou-test.js deleted file mode 100644 index 6cc8535c2..000000000 --- a/tests/acceptance/project-thankyou-test.js +++ /dev/null @@ -1,52 +0,0 @@ -import { test } from 'qunit'; -import moduleForAcceptance from 'code-corps-ember/tests/helpers/module-for-acceptance'; - -import { authenticateSession } from 'code-corps-ember/tests/helpers/ember-simple-auth'; -import createOrganizationWithSluggedRoute from 'code-corps-ember/tests/helpers/mirage/create-organization-with-slugged-route'; -import projectThankYouPage from '../pages/project/thankyou'; - -moduleForAcceptance('Acceptance | Project - ThankYou'); - -test('It requires authentication', function(assert) { - assert.expect(1); - - let organization = createOrganizationWithSluggedRoute(); - let project = server.create('project', { organization }); - - projectThankYouPage.visit({ - organization: organization.slug, - project: project.slug - }); - - andThen(() => { - assert.equal(currentRouteName(), 'login'); - }); -}); - -test('It renders project header', function(assert) { - assert.expect(5); - - let user = server.create('user'); - authenticateSession(this.application, { 'user_id': user.id }); - - let organization = createOrganizationWithSluggedRoute(); - let project = server.create('project', { organization }); - - projectThankYouPage.visit({ - organization: organization.slug, - project: project.slug - }); - - andThen(() => { - assert.ok(projectThankYouPage.rendersProjectHeader, 'Project header is rendered on the page.'); - assert.ok(projectThankYouPage.rendersIcon, 'The success icon is rendered on the page.'); - assert.ok(projectThankYouPage.rendersThankYouHeader, 'A thank you header is rendered on the page.'); - assert.ok(projectThankYouPage.rendersText, 'A descriptive text is rendered on the page.'); - - projectThankYouPage.clickProjectLink(); - }); - - andThen(() => { - assert.equal(currentRouteName(), 'project.index', 'Link leads to project page.'); - }); -}); diff --git a/tests/integration/components/thank-you-container-test.js b/tests/integration/components/thank-you-container-test.js new file mode 100644 index 000000000..b61214b7d --- /dev/null +++ b/tests/integration/components/thank-you-container-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; +import PageObject from 'ember-cli-page-object'; +import thankYouContainerComponent from '../../pages/components/thank-you-container'; + +let page = PageObject.create(thankYouContainerComponent); + +moduleForComponent('thank-you-container', 'Integration | Component | thank-you container', { + integration: true, + beforeEach() { + this.set('project', { + id: 42, + title: 'A Test Project' + }); + + page.setContext(this); + page.render(hbs`{{thank-you-container project=project}}`); + } +}); + +test('it renders the thank you text', function(assert) { + assert.expect(1); + + assert.equal(page.thankYouText, `From all the volunteers on the ${this.get('project.title')} team.`); +}); diff --git a/tests/integration/components/thankyou-container-test.js b/tests/integration/components/thankyou-container-test.js deleted file mode 100644 index c34272d0f..000000000 --- a/tests/integration/components/thankyou-container-test.js +++ /dev/null @@ -1,36 +0,0 @@ -import { moduleForComponent, test } from 'ember-qunit'; -import hbs from 'htmlbars-inline-precompile'; -import PageObject from 'ember-cli-page-object'; -import thankyouContainerComponent from '../../pages/components/thankyou-container'; - -let page = PageObject.create(thankyouContainerComponent); - -moduleForComponent('thankyou-container', 'Integration | Component | thankyou container', { - integration: true, - beforeEach() { - this.set('project', { - id: 42, - title: 'A Test Project', - iconLargeUrl: 'http://fillmurray.com/500/500' - }); - - page.setContext(this); - page.render(hbs`{{thankyou-container project=project}}`); - } -}); - -test('it sets the project icon alt attribute', function(assert) { - assert.expect(1); - assert.equal(page.icon.alt, 'Successfully donated to A Test Project'); -}); - -test('it sets the project icon src attribute', function(assert) { - assert.expect(1); - assert.equal(page.icon.src, this.get('project.iconLargeUrl')); -}); - -test('it renders the thank you text', function(assert) { - assert.expect(1); - - assert.equal(page.thankYouText, `From all the volunteers on the ${this.get('project.title')} team.`); -}); diff --git a/tests/pages/components/thankyou-container.js b/tests/pages/components/thank-you-container.js similarity index 54% rename from tests/pages/components/thankyou-container.js rename to tests/pages/components/thank-you-container.js index 13830dd00..1ec8b32c6 100644 --- a/tests/pages/components/thankyou-container.js +++ b/tests/pages/components/thank-you-container.js @@ -1,14 +1,16 @@ import { - attribute, + clickable, text } from 'ember-cli-page-object'; export default { + scope: '.thank-you-container', + icon: { - scope: '[data-test-selector="project icon"]', - alt: attribute('alt'), - src: attribute('src') + scope: '[data-test-selector="project icon"]' }, + clickLink: clickable('a'), + thankYouText: text('[data-test-selector="thank you message"]') }; diff --git a/tests/pages/project/thank-you.js b/tests/pages/project/thank-you.js new file mode 100644 index 000000000..4100b937d --- /dev/null +++ b/tests/pages/project/thank-you.js @@ -0,0 +1,8 @@ +import { create, visitable } from 'ember-cli-page-object'; +import thankYouContainer from 'code-corps-ember/tests/pages/components/thank-you-container'; + +export default create({ + visit: visitable(':organization/:project/thank-you'), + + thankYouContainer +}); diff --git a/tests/pages/project/thankyou.js b/tests/pages/project/thankyou.js deleted file mode 100644 index 2bc076ac5..000000000 --- a/tests/pages/project/thankyou.js +++ /dev/null @@ -1,12 +0,0 @@ -import { clickable, create, isVisible, visitable } from 'ember-cli-page-object'; - -export default create({ - visit: visitable(':organization/:project/thankyou'), - - clickProjectLink: clickable('.project-link a'), - - rendersProjectHeader: isVisible('.project-header'), - rendersIcon: isVisible('.icon img'), - rendersThankYouHeader: isVisible('.header'), - rendersText: isVisible('.text') -}); diff --git a/tests/unit/routes/project/thankyou-test.js b/tests/unit/routes/project/thankyou-test.js deleted file mode 100644 index 2279468af..000000000 --- a/tests/unit/routes/project/thankyou-test.js +++ /dev/null @@ -1,10 +0,0 @@ -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:project/thankyou', 'Unit | Route | project/thankyou', { - needs: ['service:metrics'] -}); - -test('it exists', function(assert) { - let route = this.subject(); - assert.ok(route); -});