Skip to content

Commit

Permalink
Ensure nested components are tested as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Mar 10, 2016
1 parent 1ef22e5 commit f9bdf5b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/acceptance/styles-lookup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ var componentRoutes = [
'classic-template-only-component',
'pod-component',
'pod-template-only-component',
'addon-component'
'addon-component',
'pod-route/nested-pod-component',
'pod-route/nested-pod-template-only-component'
].map(name => [name, `/render-component/${name}`]);

var controllerRoutes = [
Expand All @@ -30,7 +32,7 @@ var controllerRoutes = [
assert.ok(testElement);

let styles = window.getComputedStyle(testElement);
assert.equal(styles.fontFamily, name);
assert.equal(styles.fontFamily.replace(/['"]/g, ''), name);
});
});
});
5 changes: 5 additions & 0 deletions tests/dummy/app/pod-route/nested-pod-component/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Component.extend({

});
3 changes: 3 additions & 0 deletions tests/dummy/app/pod-route/nested-pod-component/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.component-class {
font-family: 'pod-route/nested-pod-component';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="{{styles.component-class}}" data-test-element>nested pod component</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.component-class {
font-family: 'pod-route/nested-pod-template-only-component';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="{{styles.component-class}}" data-test-element>nested pod component</div>
2 changes: 1 addition & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Router.map(function() {
this.route('pod-route');
this.route('pod-template-only-route');

this.route('render-component', { path: 'render-component/:component' });
this.route('render-component', { path: 'render-component/*component' });
});

export default Router;

0 comments on commit f9bdf5b

Please sign in to comment.