Skip to content

Commit

Permalink
Merge pull request #134 from davidsf/parameters-on-tests
Browse files Browse the repository at this point in the history
Pass params from wire function to TestComponentSpec.
  • Loading branch information
grantcopley authored Dec 13, 2023
2 parents 39f5f31 + 22b3537 commit 3b1b0e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions models/BaseWireTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ component extends="coldbox.system.testing.BaseTestCase" {
* @componentName Name of cbwire component.
* @return TestComponentSpec
*/
function wire( required componentName ){
function wire( required componentName, params = {} ){
return getInstance(
name = "TestComponentSpec@cbwire",
initArguments = { componentName : arguments.componentName }
initArguments = { componentName : arguments.componentName, parameters : arguments.params }
);
}

Expand Down
3 changes: 2 additions & 1 deletion models/TestComponentSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ component extends="testbox.system.BaseSpec" accessors="true" {
computedProperties[ key ] = value;
} );
}
var rendering = cbwireComponent.mount( getParameters() ).renderIt();
cbwireComponent.onMount( params = getParameters() );
var rendering = cbwireComponent.renderIt();
setRendering( rendering );
return rendering;
}
Expand Down

0 comments on commit 3b1b0e2

Please sign in to comment.