Skip to content

Commit 08dee73

Browse files
committed
Add a component with YUI docs
1 parent 815982a commit 08dee73

File tree

14 files changed

+59
-8
lines changed

14 files changed

+59
-8
lines changed

.ember-cli

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55

66
Setting `disableAnalytics` to true will prevent any data from being sent.
77
*/
8-
"disableAnalytics": false
8+
"disableAnalytics": false,
9+
"usePods": true
910
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Ember from 'ember';
2+
import layout from './template';
3+
4+
export default Ember.Component.extend({
5+
6+
layout,
7+
8+
/**
9+
The best method ever made, anywhere.
10+
@method impressUser
11+
@param {Object} features the features of the user
12+
@param {String} name the name of the user
13+
@return {String} the welcome message
14+
@public
15+
*/
16+
impressUser(features, name) {
17+
return `${name} has features ${features}`;
18+
}
19+
20+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h2>I'm a sample-component</h2>

app/components/sample-component.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from 'ember-cli-addon-docs/components/sample-component/component';

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"test": "ember try:each"
1919
},
2020
"dependencies": {
21-
"ember-cli-babel": "^5.1.7"
21+
"ember-cli-babel": "^5.1.7",
22+
"ember-cli-htmlbars": "^1.1.1"
2223
},
2324
"devDependencies": {
2425
"broccoli-asset-rev": "^2.4.5",
2526
"ember-ajax": "^2.4.1",
2627
"ember-cli": "2.12.0-beta.2",
2728
"ember-cli-dependency-checker": "^1.3.0",
2829
"ember-cli-eslint": "^3.0.0",
29-
"ember-cli-htmlbars": "^1.1.1",
3030
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
3131
"ember-cli-inject-live-reload": "^1.4.1",
3232
"ember-cli-qunit": "^3.1.0",

tests/dummy/app/controllers/.gitkeep

Whitespace-only changes.

tests/dummy/app/helpers/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<h1>Hello worldd</h1>
2+
3+
{{sample-component}}
4+
5+
<p>hum</p>
6+
7+
{{outlet}}

tests/dummy/app/routes/.gitkeep

Whitespace-only changes.

tests/dummy/app/templates/application.hbs

-5
This file was deleted.

tests/dummy/app/templates/components/.gitkeep

Whitespace-only changes.

tests/dummy/config/environment.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module.exports = function(environment) {
44
var ENV = {
55
modulePrefix: 'dummy',
6+
podModulePrefix: 'dummy/pods',
67
environment: environment,
78
rootURL: '/',
89
locationType: 'auto',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { moduleForComponent, test } from 'ember-qunit';
2+
import hbs from 'htmlbars-inline-precompile';
3+
4+
moduleForComponent('sample-component', 'Integration | Component | sample component', {
5+
integration: true
6+
});
7+
8+
test('it renders', function(assert) {
9+
10+
// Set any properties with this.set('myProperty', 'value');
11+
// Handle any actions with this.on('myAction', function(val) { ... });
12+
13+
this.render(hbs`{{sample-component}}`);
14+
15+
assert.equal(this.$().text().trim(), '');
16+
17+
// Template block usage:
18+
this.render(hbs`
19+
{{#sample-component}}
20+
template block text
21+
{{/sample-component}}
22+
`);
23+
24+
assert.equal(this.$().text().trim(), 'template block text');
25+
});

0 commit comments

Comments
 (0)