-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove attrs/attrs-arg-access #19660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
baca206
Remove attrs/attrs-arg-access
nlfurniss 4a93f80
Update packages/@ember/-internals/glimmer/tests/integration/helpers/c…
nlfurniss e4f73af
Update packages/@ember/-internals/glimmer/tests/integration/helpers/c…
nlfurniss 572ae80
Tweak test names
mixonic 7b9e496
Move transform to assertion
mixonic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
packages/ember-template-compiler/tests/plugins/assert-against-attrs-test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import TransformTestCase from '../utils/transform-test-case'; | ||
| import { moduleFor, RenderingTestCase } from 'internal-test-helpers'; | ||
|
|
||
| moduleFor( | ||
| 'ember-template-compiler: assert against attrs', | ||
| class extends TransformTestCase { | ||
| ['@test it asserts against attrs']() { | ||
| expectAssertion(() => { | ||
| this.assertTransformed(`{{attrs.foo}}`, `{{attrs.foo}}`); | ||
| }, /Using {{attrs}} to reference named arguments is not supported. {{attrs.foo}} should be updated to {{@foo}}./); | ||
|
|
||
| expectAssertion(() => { | ||
| this.assertTransformed(`{{attrs.foo.bar}}`, `{{attrs.foo.bar}}`); | ||
| }, /Using {{attrs}} to reference named arguments is not supported. {{attrs.foo.bar}} should be updated to {{@foo.bar}}./); | ||
|
|
||
| expectAssertion(() => { | ||
| this.assertTransformed(`{{if attrs.foo "foo"}}`, `{{if attrs.foo "foo"}}`); | ||
| }, /Using {{attrs}} to reference named arguments is not supported. {{attrs.foo}} should be updated to {{@foo}}./); | ||
|
|
||
| expectAssertion(() => { | ||
| this.assertTransformed(`{{#if attrs.foo}}{{/if}}`, `{{#if attrs.foo}}{{/if}}`); | ||
| }, /Using {{attrs}} to reference named arguments is not supported. {{attrs.foo}} should be updated to {{@foo}}./); | ||
|
|
||
| expectAssertion(() => { | ||
| this.assertTransformed( | ||
| `{{deeply (nested attrs.foo.bar)}}`, | ||
| `{{deeply (nested attrs.foo.bar)}}` | ||
| ); | ||
| }, /Using {{attrs}} to reference named arguments is not supported. {{attrs.foo.bar}} should be updated to {{@foo.bar}}./); | ||
| } | ||
|
|
||
| ['@test it does not assert against this.attrs']() { | ||
| this.assertTransformed(`{{this.attrs.foo}}`, `{{this.attrs.foo}}`); | ||
| this.assertTransformed(`{{if this.attrs.foo "foo"}}`, `{{if this.attrs.foo "foo"}}`); | ||
| this.assertTransformed(`{{#if this.attrs.foo}}{{/if}}`, `{{#if this.attrs.foo}}{{/if}}`); | ||
| this.assertTransformed( | ||
| `{{deeply (nested this.attrs.foo.bar)}}`, | ||
| `{{deeply (nested this.attrs.foo.bar)}}` | ||
| ); | ||
| } | ||
| } | ||
| ); | ||
|
|
||
| moduleFor( | ||
| 'ember-template-compiler: not asserting against block params named "attrs"', | ||
| class extends RenderingTestCase { | ||
| ["@test it doesn't assert block params"]() { | ||
| this.registerComponent('foo', { | ||
| template: '{{#let "foo" as |attrs|}}{{attrs}}{{/let}}', | ||
| }); | ||
| this.render('<Foo />'); | ||
| this.assertComponentElement(this.firstChild, { content: 'foo' }); | ||
| } | ||
|
|
||
| ["@test it doesn't assert component block params"]() { | ||
| this.registerComponent('foo', { | ||
| template: '{{yield "foo"}}', | ||
| }); | ||
| this.render('<Foo as |attrs|>{{attrs}}</Foo>'); | ||
| this.assertComponentElement(this.firstChild, { content: 'foo' }); | ||
| } | ||
|
|
||
| ["@test it doesn't assert block params with nested keys"]() { | ||
| this.registerComponent('foo', { | ||
| template: '{{yield (hash bar="baz")}}', | ||
| }); | ||
| this.render('<Foo as |attrs|>{{attrs.bar}}</Foo>'); | ||
| this.assertComponentElement(this.firstChild, { content: 'baz' }); | ||
| } | ||
| } | ||
| ); |
62 changes: 0 additions & 62 deletions
62
packages/ember-template-compiler/tests/plugins/transform-attrs-into-args-test.js
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.