@@ -88,7 +88,7 @@ export interface RenderOptions {
8888 Renders the provided template and appends it to the DOM.
8989
9090 @public
91- @param {Template|Component } templateOrComponent the component (or template) to render
91+ @param {Template|Component } templateFactoryOrComponent the component (or template) to render
9292 @param {RenderOptions } options options hash containing engine owner ({ owner: engineOwner })
9393 @returns {Promise<void> } resolves when settled
9494
@@ -99,12 +99,12 @@ export interface RenderOptions {
9999 await render(hbs`<div class="container"></div>`);
100100*/
101101export function render (
102- templateOrComponent : object ,
102+ templateFactoryOrComponent : object ,
103103 options ?: RenderOptions
104104) : Promise < void > {
105105 let context = getContext ( ) ;
106106
107- if ( ! templateOrComponent ) {
107+ if ( ! templateFactoryOrComponent ) {
108108 throw new Error ( 'you must pass a template to `render()`' ) ;
109109 }
110110
@@ -128,7 +128,7 @@ export function render(
128128 let OutletTemplate = lookupOutletTemplate ( owner ) ;
129129 let ownerToRenderFrom = options ?. owner || owner ;
130130
131- if ( isComponent ( templateOrComponent ) ) {
131+ if ( isComponent ( templateFactoryOrComponent ) ) {
132132 // We use this to track when `render` is used with a component so that we can throw an
133133 // assertion if `this.{set,setProperty} is used in the same test
134134 ComponentRenderMap . set ( context , true ) ;
@@ -144,19 +144,16 @@ export function render(
144144 }
145145
146146 context = {
147- ProvidedComponent : templateOrComponent ,
147+ ProvidedComponent : templateFactoryOrComponent ,
148148 } ;
149- templateOrComponent = INVOKE_PROVIDED_COMPONENT ;
150- } else {
151- templateId += 1 ;
152- let templateFullName = `template:-undertest-${ templateId } ` as const ;
153- ownerToRenderFrom . register ( templateFullName , templateOrComponent ) ;
154- templateOrComponent = lookupTemplate (
155- ownerToRenderFrom ,
156- templateFullName
157- ) ;
149+ templateFactoryOrComponent = INVOKE_PROVIDED_COMPONENT ;
158150 }
159151
152+ templateId += 1 ;
153+ let templateFullName = `template:-undertest-${ templateId } ` as const ;
154+ ownerToRenderFrom . register ( templateFullName , templateFactoryOrComponent ) ;
155+ let template = lookupTemplate ( ownerToRenderFrom , templateFullName ) ;
156+
160157 let outletState = {
161158 render : {
162159 owner, // always use the host app owner for application outlet
@@ -177,7 +174,7 @@ export function render(
177174 name : 'index' ,
178175 controller : context ,
179176 ViewClass : undefined ,
180- template : templateOrComponent ,
177+ template,
181178 outlets : { } ,
182179 } ,
183180 outlets : { } ,
0 commit comments