Skip to content

Commit

Permalink
Restore commented out tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Munoz committed May 18, 2022
1 parent 7b66063 commit 9f38ea7
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 48 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"ember-cli-uglify": "^2.0.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-font-awesome": "^4.0.0-rc.4",
"ember-load-initializers": "^1.1.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-named-arguments-polyfill": "^1.0.0",
Expand Down
63 changes: 27 additions & 36 deletions tests/integration/components/angle-bracket-invocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ module('Integration | Component | angle-bracket-invocation', function(hooks) {
assert.dom().hasText('my-helper');
});

// The following test is commented out because the ember-font-awesome is not compatible with
// modern Embers. This test should be uncommented and refactored to use a custom AST transform
// that emulates the behavior of the `fa-icon` transform in ember-font-awesome but is compatible
// with all tested versions of Ember.
//
// test('does not error when using with synthetic elements (GH#31)', async function(assert) {
// await render(hbs`{{fa-icon "camera"}}`);
test('does not error when using with synthetic elements (GH#31)', async function(assert) {
await render(hbs`{{fa-icon "camera"}}`);

// assert.dom('i').hasClass('fa-camera');
// });
assert.dom('i').hasClass('fa-camera');
});

test('single word components', async function(assert) {
this.owner.register('template:components/foo', hbs`hi martin!`);
Expand Down Expand Up @@ -273,33 +268,29 @@ module('Integration | Component | angle-bracket-invocation', function(hooks) {
assert.dom().hasText('hi rwjblue!');
});

// The following test is commented out because the template does not even compile in modern Embers
// with the error "You used elsewhere.curriedThing as a tag name, but elsewhere is not in scope".
// This test can be uncommented once it can be conditionally run only in older Embers.
//
// test('invoke dynamic - path no implicit this', async function(assert) {
// this.owner.register('service:elsewhere', Service.extend());
// this.owner.register(
// 'component:x-invoker',
// Component.extend({
// elsewhere: injectService(),

// init() {
// this._super(...arguments);

// let elsewhere = this.get('elsewhere');
// elsewhere.set('curriedThing', this.curriedThing);
// },
// })
// );
// this.owner.register('template:components/x-invoker', hbs`<elsewhere.curriedThing />`);
// this.owner.register('template:components/foo-bar', hbs`hi rwjblue!`);

// await render(hbs`{{x-invoker curriedThing=(component 'foo-bar')}}`);

// // should not have rendered anything (no implicit `this`)
// assert.dom().hasText('');
// });
test('invoke dynamic - path no implicit this', async function(assert) {
this.owner.register('service:elsewhere', Service.extend());
this.owner.register(
'component:x-invoker',
Component.extend({
elsewhere: injectService(),

init() {
this._super(...arguments);

let elsewhere = this.get('elsewhere');
elsewhere.set('curriedThing', this.curriedThing);
},
})
);
this.owner.register('template:components/x-invoker', hbs`<elsewhere.curriedThing />`);
this.owner.register('template:components/foo-bar', hbs`hi rwjblue!`);

await render(hbs`{{x-invoker curriedThing=(component 'foo-bar')}}`);

// should not have rendered anything (no implicit `this`)
assert.dom().hasText('');
});
});

module('has-block', function(hooks) {
Expand Down
Loading

0 comments on commit 9f38ea7

Please sign in to comment.