Skip to content

Commit

Permalink
I think everything is green?
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 9, 2024
1 parent fb96b9b commit 95e4c1e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
Expand Up @@ -903,7 +903,7 @@ if (ENV._DEBUG_RENDER_TREE) {
name: 'hello-world',
args: { positional: [], named: { name: 'first' } },
instance: null,
template: 'my-app/templates/components/hello-world.hbs',
template: '(unknown template module)',
bounds: this.nodeBounds(this.element!.firstChild),
children: [],
},
Expand All @@ -919,7 +919,7 @@ if (ENV._DEBUG_RENDER_TREE) {
name: 'hello-world',
args: { positional: [], named: { name: 'first' } },
instance: null,
template: 'my-app/templates/components/hello-world.hbs',
template: '(unknown template module)',
bounds: this.nodeBounds(this.element!.firstChild),
children: [],
},
Expand All @@ -928,7 +928,7 @@ if (ENV._DEBUG_RENDER_TREE) {
name: 'hello-world',
args: { positional: [], named: { name: 'second' } },
instance: null,
template: 'my-app/templates/components/hello-world.hbs',
template: '(unknown template module)',
bounds: this.nodeBounds(this.element!.lastChild),
children: [],
},
Expand All @@ -944,7 +944,7 @@ if (ENV._DEBUG_RENDER_TREE) {
name: 'hello-world',
args: { positional: [], named: { name: 'first' } },
instance: null,
template: 'my-app/templates/components/hello-world.hbs',
template: '(unknown template module)',
bounds: this.nodeBounds(this.element!.firstChild),
children: [],
},
Expand Down
@@ -1,4 +1,10 @@
import { moduleFor, RenderingTestCase, classes, runTask } from 'internal-test-helpers';
import {
moduleFor,
RenderingTestCase,
classes,
runTask,
defineComponent,
} from 'internal-test-helpers';
import { ENV } from '@ember/-internals/environment';
import { setComponentTemplate } from '@glimmer/manager';
import { templateOnlyComponent } from '@glimmer/runtime';
Expand All @@ -7,13 +13,12 @@ import EmberObject from '@ember/object';
import { Component } from '../../utils/helpers';
import { backtrackingMessageFor } from '../../utils/debug-stack';

class TemplateOnlyComponentsTest extends RenderingTestCase {
registerTemplateOnlyComponent(name, template) {
super.registerComponent(name, { template, ComponentClass: null });
}
}

if (ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) {
class TemplateOnlyComponentsTest extends RenderingTestCase {
registerTemplateOnlyComponent(name, template) {
this.owner.register(`component:${name}`, defineComponent(null, template));
}
}
moduleFor(
'Components test: template-only components (glimmer components)',
class extends TemplateOnlyComponentsTest {
Expand Down Expand Up @@ -158,6 +163,15 @@ if (ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) {
}
);
} else {
class TemplateOnlyComponentsTest extends RenderingTestCase {
registerTemplateOnlyComponent(name, template) {
this.owner.register(
`component:${name}`,
defineComponent(null, template, Component.extend({}))
);
}
}

moduleFor(
'Components test: template-only components (curly components)',
class extends TemplateOnlyComponentsTest {
Expand Down
5 changes: 4 additions & 1 deletion packages/ember/tests/component_registration_test.js
Expand Up @@ -21,7 +21,10 @@ moduleFor(
return;
}

this.add('component:expand-it', defineComponent({}, '<p>hello {{yield}}</p>'));
this.add(
'component:expand-it',
defineComponent({}, '<p>hello {{yield}}</p>', Component.extend({}))
);
this.addTemplate('application', 'Hello world {{#expand-it}}world{{/expand-it}}');

return this.visit('/').then(() => {
Expand Down

0 comments on commit 95e4c1e

Please sign in to comment.