@@ -26,6 +26,10 @@ ruleTester.run('template-deprecated-inline-view-helper', rule, {
2626 '<template>{{#let this.prop as |view|}} {{view}} {{/let}}</template>' ,
2727 // isLocal: view is a block param, view.name should not be flagged
2828 '<template>{{#each items as |view|}} {{view.name}} {{/each}}</template>' ,
29+ // yield with view hash pair should not be flagged
30+ '<template>{{yield hash=view.foo}}</template>' ,
31+ // hash pair with key "to" should not be flagged
32+ '<template>{{some-component to=view.foo}}</template>' ,
2933 ] ,
3034 invalid : [
3135 {
@@ -53,6 +57,11 @@ ruleTester.run('template-deprecated-inline-view-helper', rule, {
5357 output : '<template>{{foo-bar bab=good baz=qux.qaz boo=okay}}</template>' ,
5458 errors : [ { messageId : 'deprecated' } ] ,
5559 } ,
60+ {
61+ code : '<template><div class={{view.something}}></div></template>' ,
62+ output : '<template><div class={{something}}></div></template>' ,
63+ errors : [ { messageId : 'deprecated' } ] ,
64+ } ,
5665 {
5766 code : '<template><div class="whatever-class" data-foo={{view.hallo}} sure=thing></div></template>' ,
5867 output :
@@ -93,6 +102,10 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
93102 '{{#let this.prop as |view|}} {{view}} {{/let}}' ,
94103 // isLocal: view is a block param, view.name should not be flagged
95104 '{{#each items as |view|}} {{view.name}} {{/each}}' ,
105+ // yield with view hash pair should not be flagged
106+ '{{yield hash=view.foo}}' ,
107+ // hash pair with key "to" should not be flagged
108+ '{{some-component to=view.foo}}' ,
96109 ] ,
97110 invalid : [
98111 {
@@ -135,6 +148,16 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
135148 } ,
136149 ] ,
137150 } ,
151+ {
152+ code : '<div class={{view.something}}></div>' ,
153+ output : '<div class={{something}}></div>' ,
154+ errors : [
155+ {
156+ message :
157+ 'The inline form of `view` is deprecated. Please use `Ember.Component` instead. See http://emberjs.com/deprecations/v1.x/#toc_ember-view' ,
158+ } ,
159+ ] ,
160+ } ,
138161 {
139162 code : '<div class="whatever-class" data-foo={{view.hallo}} sure=thing></div>' ,
140163 output : '<div class="whatever-class" data-foo={{hallo}} sure=thing></div>' ,
0 commit comments