@@ -10,6 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
1010governing permissions and limitations under the License.
1111*/
1212
13+ const { cli } = require ( 'cli-ux' )
1314const { setStore } = require ( '@adobe/aio-cna-core-config' )
1415const ListAvailableLogOptionsCommand = require ( '../../src/commands/cloudmanager/list-available-log-options' )
1516
@@ -70,11 +71,12 @@ test('list-available-logs - success undefined', async () => {
7071 'cloudmanager_programid' : "4"
7172 } )
7273
73- expect . assertions ( 2 )
74+ expect . assertions ( 3 )
7475
7576 let runResult = ListAvailableLogOptionsCommand . run ( [ "3" ] )
7677 await expect ( runResult instanceof Promise ) . toBeTruthy ( )
7778 await expect ( runResult ) . resolves . toEqual ( [ ] )
79+ await expect ( cli . info . mock . calls [ 0 ] [ 0 ] ) . toBe ( "No log options are available for environmentId 3" )
7880} )
7981
8082test ( 'list-available-logs - success empty' , async ( ) => {
@@ -88,11 +90,12 @@ test('list-available-logs - success empty', async () => {
8890 'cloudmanager_programid' : "4"
8991 } )
9092
91- expect . assertions ( 2 )
93+ expect . assertions ( 3 )
9294
9395 let runResult = ListAvailableLogOptionsCommand . run ( [ "2" ] )
9496 await expect ( runResult instanceof Promise ) . toBeTruthy ( )
9597 await expect ( runResult ) . resolves . toEqual ( [ ] )
98+ await expect ( cli . info . mock . calls [ 0 ] [ 0 ] ) . toBe ( "No log options are available for environmentId 2" )
9699} )
97100
98101test ( 'list-available-logs - success' , async ( ) => {
@@ -106,7 +109,7 @@ test('list-available-logs - success', async () => {
106109 'cloudmanager_programid' : "4"
107110 } )
108111
109- expect . assertions ( 2 )
112+ expect . assertions ( 3 )
110113
111114 let runResult = ListAvailableLogOptionsCommand . run ( [ "1" ] )
112115 await expect ( runResult instanceof Promise ) . toBeTruthy ( )
@@ -146,6 +149,8 @@ test('list-available-logs - success', async () => {
146149 "service" : "dispatcher" ,
147150 "name" : "aemdispatcher"
148151 } ] )
152+
153+ await expect ( cli . table . mock . calls [ 0 ] [ 1 ] . id . get ( { environmentId : 1 } ) ) . toBe ( "1" )
149154} )
150155
151156
0 commit comments