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