Skip to content

Commit

Permalink
Base tests pass again after test harness updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 25, 2024
1 parent 8314402 commit c7508cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {

import ComponentStateBucket from '../utils/curly-component-state-bucket';
import { processComponentArgs } from '../utils/process-args';
import { getComponentTemplate } from '@ember/component';

export const ARGS = enumerableSymbol('ARGS');
export const HAS_BLOCK = enumerableSymbol('HAS_BLOCK');
Expand Down Expand Up @@ -133,6 +134,12 @@ export default class CurlyComponentManager
let factory: TemplateFactory;

if (layout === undefined) {
let theSetTemplate = getComponentTemplate(component);

if (theSetTemplate) {
return unwrapTemplate(theSetTemplate(owner)).asWrappedLayout();
}

if (layoutName !== undefined) {
let _factory = owner.lookup(`template:${layoutName}`) as TemplateFactory;
assert(`Layout \`${layoutName}\` not found!`, _factory !== undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AbstractAppendTest extends RenderingTestCase {
this._super(...arguments);
},
}),
template: _options.template,
resolveableTemplate: _options.resolveableTemplate,
};

oldRegisterComponent.call(this, name, options);
Expand All @@ -121,7 +121,7 @@ class AbstractAppendTest extends RenderingTestCase {
layoutName: 'components/x-parent',
}),

template:
resolveableTemplate:
'[parent: {{this.foo}}]{{#x-child bar=this.foo}}[yielded: {{this.foo}}]{{/x-child}}',
});

Expand All @@ -130,7 +130,7 @@ class AbstractAppendTest extends RenderingTestCase {
tagName: '',
}),

template: '[child: {{this.bar}}]{{yield}}',
resolveableTemplate: '[child: {{this.bar}}]{{yield}}',
});

let XParent;
Expand Down Expand Up @@ -294,7 +294,7 @@ class AbstractAppendTest extends RenderingTestCase {
},
}),

template:
resolveableTemplate:
'[parent: {{this.foo}}]{{#x-child bar=this.foo}}[yielded: {{this.foo}}]{{/x-child}}',
});

Expand All @@ -303,7 +303,7 @@ class AbstractAppendTest extends RenderingTestCase {
tagName: '',
}),

template: '[child: {{this.bar}}]{{yield}}',
resolveableTemplate: '[child: {{this.bar}}]{{yield}}',
});

let XParent;
Expand Down Expand Up @@ -401,7 +401,7 @@ class AbstractAppendTest extends RenderingTestCase {
},
}),

template: 'x-first {{this.foo}}!',
resolveableTemplate: 'x-first {{this.foo}}!',
});

this.registerComponent('x-second', {
Expand All @@ -413,7 +413,7 @@ class AbstractAppendTest extends RenderingTestCase {
},
}),

template: 'x-second {{this.bar}}!',
resolveableTemplate: 'x-second {{this.bar}}!',
});

let First, Second;
Expand Down Expand Up @@ -704,7 +704,7 @@ moduleFor(
ComponentClass: Component.extend({
layoutName: 'components/foo-bar',
}),
template: 'FOO BAR!',
resolveableTemplate: 'FOO BAR!',
});

let FooBar = this.owner.factoryFor('component:foo-bar');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ moduleFor(

this.registerComponent('foo-bar', {
ComponentClass,
template: 'this should not be rendered',
resolveableTemplate: 'this should not be rendered',
});

this.render('{{foo-bar}}');
Expand Down

0 comments on commit c7508cc

Please sign in to comment.