Skip to content

Commit

Permalink
update set assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
cafreeman committed Apr 12, 2022
1 parent a749f81 commit d41647a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions addon-test-support/@ember/test-helpers/setup-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export default function setupContext(
let ret = run(function () {
if (ComponentRenderMap.has(context)) {
assert(
'Calling `this.set` when rendering a component does not work since components do not have access to the test context.'
'You cannot call `this.set` when you have passed a component to `render()` (the rendered component does not have access to the test context).'
);
}
return set(context, key, value);
Expand All @@ -438,7 +438,7 @@ export default function setupContext(
let ret = run(function () {
if (ComponentRenderMap.has(context)) {
assert(
'Calling `this.setProperties` when rendering a component does not work since components do not have access to the test context.'
'You cannot call `this.setProperties` when you have passed a component to `render()` (the rendered component does not have access to the test context)'
);
}
return setProperties(context, hash);
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/setup-rendering-context-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
_registerHook,
getTestMetadata,
render,
rerender,
clearRender,
setApplication,
setResolver,
Expand Down Expand Up @@ -674,7 +673,7 @@ module('setupRenderingContext', function (hooks) {
return err
.toString()
.includes(
'Calling `this.set` when rendering a component does not work since components do not have access to the test context.'
'You cannot call `this.set` when you have passed a component to `render()` (the rendered component does not have access to the test context).'
);
},
'errors on this.set'
Expand All @@ -686,7 +685,7 @@ module('setupRenderingContext', function (hooks) {
return err
.toString()
.includes(
'Calling `this.setProperties` when rendering a component does not work since components do not have access to the test context.'
'You cannot call `this.setProperties` when you have passed a component to `render()` (the rendered component does not have access to the test context)'
);
},
'errors on this.setProperties'
Expand Down Expand Up @@ -797,7 +796,7 @@ module('setupRenderingContext', function (hooks) {
return err
.toString()
.includes(
'Calling `this.set` when rendering a component does not work since components do not have access to the test context.'
'You cannot call `this.set` when you have passed a component to `render()` (the rendered component does not have access to the test context).'
);
},
'errors on this.set'
Expand Down

0 comments on commit d41647a

Please sign in to comment.