@@ -61,8 +61,11 @@ test("reflection - model", () => {
61
61
const reflection = getMembers ( node )
62
62
expect ( reflection . name ) . toBe ( "AnonymousModel" )
63
63
expect ( reflection . actions . includes ( "actionName" ) ) . toBe ( true )
64
+ expect ( reflection . actions . includes ( "generatorAction" ) ) . toBe ( true )
64
65
expect ( reflection . flowActions . includes ( "generatorAction" ) ) . toBe ( true )
66
+ expect ( reflection . flowActions . includes ( "actionName" ) ) . toBe ( false )
65
67
expect ( reflection . views . includes ( "viewName" ) ) . toBe ( true )
68
+ expect ( reflection . views . includes ( "actionName" ) ) . toBe ( false )
66
69
expect ( reflection . volatile . includes ( "volatileProperty" ) ) . toBe ( true )
67
70
expect ( ! ! reflection . properties . users ) . toBe ( true )
68
71
expect ( ! ! reflection . properties . isPerson ) . toBe ( true )
@@ -166,6 +169,20 @@ test("reflection - members chained", () => {
166
169
}
167
170
}
168
171
} )
172
+ . actions ( ( self ) => {
173
+ function flowActionName ( ) {
174
+ return 1
175
+ }
176
+ return {
177
+ flowActionName,
178
+ generatorAction : flow ( function * generatorAction ( ) {
179
+ const promise = new Promise ( ( resolve ) => {
180
+ resolve ( true )
181
+ } )
182
+ yield promise
183
+ } )
184
+ }
185
+ } )
169
186
. views ( ( self ) => ( {
170
187
get viewName ( ) {
171
188
return 1
@@ -182,8 +199,15 @@ test("reflection - members chained", () => {
182
199
expect ( keys . includes ( "isPerson" ) ) . toBe ( true )
183
200
expect ( reflection . actions . includes ( "actionName" ) ) . toBe ( true )
184
201
expect ( reflection . actions . includes ( "anotherAction" ) ) . toBe ( true )
202
+ expect ( reflection . actions . includes ( "flowActionName" ) ) . toBe ( true )
203
+ expect ( reflection . actions . includes ( "generatorAction" ) ) . toBe ( true )
204
+ expect ( reflection . flowActions . includes ( "generatorAction" ) ) . toBe ( true )
205
+ expect ( reflection . flowActions . includes ( "flowActionName" ) ) . toBe ( false )
185
206
expect ( reflection . views . includes ( "viewName" ) ) . toBe ( true )
186
207
expect ( reflection . views . includes ( "anotherView" ) ) . toBe ( true )
208
+ expect ( reflection . views . includes ( "actionName" ) ) . toBe ( false )
209
+ expect ( reflection . views . includes ( "anotherAction" ) ) . toBe ( false )
210
+ expect ( reflection . views . includes ( "flowActionName" ) ) . toBe ( false )
187
211
} )
188
212
test ( "reflection - conditionals respected" , ( ) => {
189
213
let swap = true
0 commit comments