-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change expectComponent, expectView, lookup* to take container
- Loading branch information
Showing
8 changed files
with
54 additions
and
21 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
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
4 changes: 2 additions & 2 deletions
4
test-support/helpers/201-created/utils/find-component-elements.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
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,11 +1,11 @@ | ||
export function lookupRouter(app){ | ||
return app.__container__.lookup('router:main'); | ||
export function lookupRouter(container){ | ||
return container.lookup('router:main'); | ||
} | ||
|
||
export function lookupComponent(app, componentName){ | ||
return app.__container__.lookupFactory('component:' + componentName); | ||
export function lookupComponent(container, componentName){ | ||
return container.lookupFactory('component:' + componentName); | ||
} | ||
|
||
export function lookupView(app, viewName){ | ||
return app.__container__.lookupFactory('view:' + viewName); | ||
export function lookupView(container, viewName){ | ||
return container.lookupFactory('view:' + viewName); | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/integration/expect-component-hbs-integration-test.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Ember from 'ember'; | ||
import expectComponent from '../helpers/201-created/raw/expect-component'; | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('simple-component', { | ||
integration: true | ||
}); | ||
|
||
test('finds root component in hbs integration test', function(assert) { | ||
this.render(hbs`{{simple-component}}`); | ||
var result = expectComponent(this.container, 'simple-component', 1); | ||
assert.ok(result.ok, "expected success"); | ||
}); | ||
|
||
test('does not find component when not present in hbs integration test', function(assert) { | ||
this.render(hbs`{{another-component}}`); | ||
var result = expectComponent(this.container, 'simple-component', 1); | ||
assert.ok(!result.ok, "expected a failure"); | ||
}); | ||
|
||
test('finds inner component in hbs integration test', function(assert) { | ||
this.render(hbs`{{compound-component}}`); | ||
var result = expectComponent(this.container, 'simple-component', 1); | ||
assert.ok(result.ok, "expected success"); | ||
}); | ||
|