-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename to thank-you; update BEM; update tests
- Loading branch information
Showing
23 changed files
with
142 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Ember from 'ember'; | ||
|
||
const { | ||
Component | ||
} = Ember; | ||
|
||
export default Component.extend({ | ||
classNames: ['thank-you-container'] | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="thank-you-container__project-icon" data-test-selector="project icon"></div> | ||
<h3>Thank you!</h3> | ||
<div class="thank-you-container__message"> | ||
<p data-test-selector="thank you message"> | ||
From all the volunteers on the {{project.title}} team. | ||
</p> | ||
<p> | ||
{{link-to "Back to project" "project" project.organization.slug project.slug}} | ||
</p> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{project-header project=model}} | ||
{{thank-you-container project=model}} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.`); | ||
}); |
This file was deleted.
Oops, something went wrong.
10 changes: 6 additions & 4 deletions
10
tests/pages/components/thankyou-container.js → ...s/pages/components/thank-you-container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"]') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.