Skip to content

Commit

Permalink
Remove tests for code that was supposed to be removed in v4
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Mar 27, 2024
1 parent a0845f4 commit 6bce2f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 38 deletions.
Expand Up @@ -1269,7 +1269,7 @@ moduleFor(

['@test non-block with properties on this.attrs']() {
this.registerComponent('non-block', {
template: 'In layout - someProp: {{this.attrs.someProp}}{{log this.attrs}}',
template: 'In layout - someProp: {{@someProp}}',
});

this.render('{{non-block someProp=this.prop}}', {
Expand Down Expand Up @@ -1476,13 +1476,10 @@ moduleFor(
);
}

['@test this.attrs.foo === @foo === foo']() {
['@test @foo === foo']() {
this.registerComponent('foo-bar', {
template: strip`
Args: {{this.attrs.value}} | {{@value}} | {{this.value}}
{{#each this.attrs.items as |item|}}
{{item}}
{{/each}}
Args: {{@value}} | {{this.value}}
{{#each @items as |item|}}
{{item}}
{{/each}}
Expand All @@ -1506,11 +1503,11 @@ moduleFor(
this.context.set('model.items', [1]);
});

this.assertText(strip`Args: lul | lul | lul111`);
this.assertText(strip`Args: lul | lul11`);

runTask(() => this.context.set('model', { value: 'wat', items: [1, 2, 3] }));

this.assertText('Args: wat | wat | wat123123123');
this.assertText('Args: wat | wat123123');
}

['@test non-block with properties on self']() {
Expand Down Expand Up @@ -1575,36 +1572,6 @@ moduleFor(
}, "Using {{attrs}} to reference named arguments is not supported. {{attrs.someProp}} should be updated to {{@someProp}}. ('my-app/templates/components/with-block.hbs' @ L1:C24) ");
}

['@test block with properties on this.attrs']() {
this.registerComponent('with-block', {
template: 'In layout - someProp: {{this.attrs.someProp}} - {{yield}}',
});

this.render(
strip`
{{#with-block someProp=this.prop}}
In template
{{/with-block}}`,
{
prop: 'something here',
}
);

this.assertText('In layout - someProp: something here - In template');

runTask(() => this.rerender());

this.assertText('In layout - someProp: something here - In template');

runTask(() => this.context.set('prop', 'something else'));

this.assertText('In layout - someProp: something else - In template');

runTask(() => this.context.set('prop', 'something here'));

this.assertText('In layout - someProp: something here - In template');
}

['@test block with named argument']() {
this.registerComponent('with-block', {
template: 'In layout - someProp: {{@someProp}} - {{yield}}',
Expand Down
Expand Up @@ -32,6 +32,7 @@ export default function assertAgainstAttrs(env: EmberASTPluginEnvironment): ASTP
stack.push(parent.concat(blockParams));
}

// https://deprecations.emberjs.com/v3.x#toc_attrs-arg-access
return {
name: 'assert-against-attrs',

Expand Down

0 comments on commit 6bce2f9

Please sign in to comment.