Skip to content

Commit

Permalink
Leave note about test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
chadhietala committed Oct 4, 2016
1 parent 3ebc946 commit 0d270ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/container/lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ENV } from 'ember-environment';
import { assert, deprecate, runInDebug, isFeatureEnabled } from 'ember-metal';

const CONTAINER_OVERRIDE = symbol('CONTAINER_OVERRIDE');
export const HAS_PROXY = !!Proxy;
export const HAS_PROXY = window && window.Proxy;

/**
A container used to instantiate and cache objects.
Expand Down
45 changes: 23 additions & 22 deletions packages/ember/tests/helpers/helper_registration_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Controller /*, Service, inject*/} from 'ember-runtime';
import { Controller, Service, inject } from 'ember-runtime';
import { run } from 'ember-metal';
import { compile } from 'ember-template-compiler';
import {
//Helper,
Helper,
helper,
setTemplates,
setTemplate
Expand Down Expand Up @@ -90,23 +90,24 @@ QUnit.test('Undashed helpers registered on the container can be invoked', functi
equal(jQuery('#wrapper').text(), 'OMG|boo|ya', 'The helper was invoked from the container');
});

// QUnit.test('Helpers can receive injections', function() {
// setTemplate('application', compile('<div id=\'wrapper\'>{{full-name}}</div>'));

// let serviceCalled = false;
// boot(() => {
// appInstance.register('service:name-builder', Service.extend({
// build() {
// serviceCalled = true;
// }
// }));
// appInstance.register('helper:full-name', Helper.extend({
// nameBuilder: inject.service('name-builder'),
// compute() {
// this.get('nameBuilder').build();
// }
// }));
// });

// ok(serviceCalled, 'service was injected, method called');
// });
// This fails with: Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.
QUnit.skip('Helpers can receive injections', function() {
setTemplate('application', compile('<div id=\'wrapper\'>{{full-name}}</div>'));

let serviceCalled = false;
boot(() => {
appInstance.register('service:name-builder', Service.extend({
build() {
serviceCalled = true;
}
}));
appInstance.register('helper:full-name', Helper.extend({
nameBuilder: inject.service('name-builder'),
compute() {
this.get('nameBuilder').build();
}
}));
});

ok(serviceCalled, 'service was injected, method called');
});

0 comments on commit 0d270ce

Please sign in to comment.