@@ -62,6 +62,20 @@ describe('determinePropertyType', () => {
62
62
) . toStrictEqual ( 'service' ) ;
63
63
} ) ;
64
64
65
+ it ( 'should determine controller-type props with full import' , ( ) => {
66
+ const context = new FauxContext (
67
+ `import Ember from 'ember';
68
+ export default Controller.extend({
69
+ application: Ember.inject.controller(),
70
+ });`
71
+ ) ;
72
+ const importEmberName = context . ast . body [ 0 ] . specifiers [ 0 ] . local . name ;
73
+ const node = context . ast . body [ 1 ] . declaration . arguments [ 0 ] . properties [ 0 ] ;
74
+ expect (
75
+ propertyOrder . determinePropertyType ( node , 'controller' , [ ] , importEmberName )
76
+ ) . toStrictEqual ( 'controller' ) ;
77
+ } ) ;
78
+
65
79
it ( 'should determine controller-type props' , ( ) => {
66
80
const context = new FauxContext (
67
81
`export default Controller.extend({
@@ -136,6 +150,20 @@ describe('determinePropertyType', () => {
136
150
expect ( propertyOrder . determinePropertyType ( node , 'model' ) ) . toStrictEqual ( 'relationship' ) ;
137
151
} ) ;
138
152
153
+ it ( 'should determine observer-type props with full import' , ( ) => {
154
+ const context = new FauxContext (
155
+ `import Ember from 'ember';
156
+ export default Controller.extend({
157
+ someObvs: Ember.observer(),
158
+ });`
159
+ ) ;
160
+ const importEmberName = context . ast . body [ 0 ] . specifiers [ 0 ] . local . name ;
161
+ const node = context . ast . body [ 1 ] . declaration . arguments [ 0 ] . properties [ 0 ] ;
162
+ expect (
163
+ propertyOrder . determinePropertyType ( node , 'controller' , [ ] , importEmberName )
164
+ ) . toStrictEqual ( 'observer' ) ;
165
+ } ) ;
166
+
139
167
it ( 'should determine observer-type props' , ( ) => {
140
168
const context = new FauxContext (
141
169
`export default Controller.extend({
0 commit comments