@@ -18,6 +18,7 @@ const common = require('../../../lib/common'),
18
18
openwhisk = require ( '../../../lib/openwhisk' ) ,
19
19
ui = require ( '../../../lib/ui' ) ,
20
20
assert = require ( 'assert' ) ,
21
+ path = require ( 'path' ) ,
21
22
keys = ui . keys ,
22
23
cli = ui . cli ,
23
24
sidecar = ui . sidecar ,
@@ -46,6 +47,32 @@ describe('wsk action invoke with implicit entity', function() {
46
47
. catch ( common . oops ( this ) ) )
47
48
}
48
49
50
+ const paramsJson = require ( path . join ( __dirname , '../../../data/params.json' ) )
51
+
52
+ it ( `should invoke ${ actionName } with implicit entity and --param-file` , ( ) => cli . do ( `invoke --param-file ./data/params.json` , this . app )
53
+ . then ( cli . expectOK )
54
+ . then ( sidecar . expectOpen )
55
+ . then ( sidecar . expectShowing ( actionName ) )
56
+ . then ( ( ) => this . app . client . getText ( ui . selectors . SIDECAR_ACTIVATION_RESULT ) )
57
+ . then ( ui . expectStruct ( Object . assign ( { x :3 } , paramsJson ) ) )
58
+ . catch ( common . oops ( this ) ) )
59
+
60
+ it ( `should invoke ${ actionName } with implicit entity and -P` , ( ) => cli . do ( `invoke -P ./data/params.json` , this . app )
61
+ . then ( cli . expectOK )
62
+ . then ( sidecar . expectOpen )
63
+ . then ( sidecar . expectShowing ( actionName ) )
64
+ . then ( ( ) => this . app . client . getText ( ui . selectors . SIDECAR_ACTIVATION_RESULT ) )
65
+ . then ( ui . expectStruct ( Object . assign ( { x :3 } , paramsJson ) ) )
66
+ . catch ( common . oops ( this ) ) )
67
+
68
+ it ( `should invoke ${ actionName } with explicit entity and -P` , ( ) => cli . do ( `invoke ${ actionName } -P ./data/params.json` , this . app )
69
+ . then ( cli . expectOK )
70
+ . then ( sidecar . expectOpen )
71
+ . then ( sidecar . expectShowing ( actionName ) )
72
+ . then ( ( ) => this . app . client . getText ( ui . selectors . SIDECAR_ACTIVATION_RESULT ) )
73
+ . then ( ui . expectStruct ( Object . assign ( { x :3 } , paramsJson ) ) )
74
+ . catch ( common . oops ( this ) ) )
75
+
49
76
it ( `should fail when requesting parameters of an activation` , ( ) => cli . do ( 'params' , this . app )
50
77
. then ( cli . expectError ( 0 , 'The current entity does not support viewing parameters' ) )
51
78
. catch ( common . oops ( this ) ) )
0 commit comments