-
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.
Updated skills list by adding user-skills page component and skills-l…
…ist-test integration test
- Loading branch information
Showing
10 changed files
with
86 additions
and
46 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,7 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
classNames: ['user__skills-list'], | ||
|
||
user: null | ||
}); |
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
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,16 @@ | ||
.user__skills-list { | ||
ul { | ||
align-items: flex-start; | ||
display: flex; | ||
margin-top: 10px; | ||
|
||
li { | ||
background: #E8EBED; | ||
border-radius: 2px; | ||
color: #333; | ||
font-weight: 600; | ||
margin-right: 5px; | ||
padding: 4px 7px; | ||
} | ||
} | ||
} |
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
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,5 @@ | ||
<ul> | ||
{{#each user.userSkills as |userSkill|}} | ||
<li data-test-user-skills-list-item>{{userSkill.skill.title}}</li> | ||
{{/each}} | ||
</ul> |
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,43 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import PageObject from 'ember-cli-page-object'; | ||
import userSkillsList from 'code-corps-ember/tests/pages/components/user/skills-list'; | ||
|
||
let page = PageObject.create(userSkillsList); | ||
|
||
let user = { | ||
userSkills: [ | ||
{ | ||
skill: { | ||
title: 'Ember.js' | ||
} | ||
}, | ||
{ | ||
skill: { | ||
title: 'JavaScript' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
moduleForComponent('user/skills-list', 'Integration | Component | user/skills list', { | ||
integration: true, | ||
beforeEach() { | ||
page.setContext(this); | ||
}, | ||
afterEach() { | ||
page.removeContext(); | ||
} | ||
}); | ||
|
||
test('it renders each skill in the list', function(assert) { | ||
assert.expect(3); | ||
|
||
this.set('user', user); | ||
|
||
page.render(hbs`{{user/skills-list user=user}}`); | ||
|
||
assert.equal(page.listItems().count, 2); | ||
assert.equal(page.listItems(0).text, 'Ember.js'); | ||
assert.equal(page.listItems(1).text, 'JavaScript'); | ||
}); |
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,11 @@ | ||
import { | ||
collection | ||
} from 'ember-cli-page-object'; | ||
|
||
export default { | ||
scope: '.user__skills-list', | ||
|
||
listItems: collection({ | ||
itemScope: '[data-test-user-skills-list-item]' | ||
}) | ||
}; |