Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start working on making the alpha pass. #168

Merged
merged 1 commit into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,26 @@ module.exports = {
}
}
},
{
name: 'ember-alpha',
allowedToFail: true,
bower: {
dependencies: {
"ember": "alpha"
},
devDependencies: {
"ember-cli-shims": "ember-cli/ember-cli-shims#0.1.0"
},
resolutions: {
"ember": "alpha"
}
},
npm: {
devDependencies: {
"ember-data": "^2.5.0"
}
}
},
{
name: 'ember-data-2.3',
bower: {
Expand Down
28 changes: 22 additions & 6 deletions lib/ember-test-helpers/test-module-for-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,12 @@ export default TestModule.extend({
context.dispatcher = this.container.lookup('event_dispatcher:main') || Ember.EventDispatcher.create();
context.dispatcher.setup({}, '#ember-testing');

var hasRendered = false;
var OutletView = module.container.lookupFactory('view:-outlet');
var toplevelView = module.component = OutletView.create();
toplevelView.setOutletState({ render: { }, outlets: { }});

var element = document.getElementById('ember-testing');
Ember.run(module.component, 'appendTo', '#ember-testing');

var templateId = 0;
context.render = function(template) {
if (!template) {
throw new Error("in a component integration test you must pass a template to `render()`");
Expand All @@ -160,17 +159,29 @@ export default TestModule.extend({
template = Ember.Handlebars.compile(template);
}

Ember.run(function() {
var templateFullName = 'template:-undertest-' + (++templateId);
this.registry.register(templateFullName, template);
Ember.run(() => {
toplevelView.setOutletState({
render: {
owner: this.owner,
into: undefined,
outlet: 'main',
name: 'application',
controller: module.context,
template
ViewClass: undefined,
template: this.container.lookup(templateFullName)
},

outlets: { }
});
});

if (!hasRendered) {
Ember.run(module.component, 'appendTo', '#ember-testing');
hasRendered = true;
}

// ensure the element is based on the wrapping toplevel view
// Ember still wraps the main application template with a
// normal tagged view
Expand Down Expand Up @@ -228,8 +239,13 @@ export default TestModule.extend({
Ember.run(function() {
toplevelView.setOutletState({
render: {
owner: module.container,
into: undefined,
outlet: 'main',
name: 'application',
controller: module.context,
randomKey: 'empty'
ViewClass: undefined,
template: undefined
},
outlets: {}
});
Expand Down