@@ -1133,6 +1133,7 @@ describe('manage nsfs cli account flow', () => {
1133
1133
const account_options = { config_root } ;
1134
1134
const action = ACTIONS . LIST ;
1135
1135
const res = await exec_manage_cli ( type , action , account_options ) ;
1136
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1136
1137
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1137
1138
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1138
1139
} ) ;
@@ -1141,6 +1142,7 @@ describe('manage nsfs cli account flow', () => {
1141
1142
const account_options = { config_root, wide : true } ;
1142
1143
const action = ACTIONS . LIST ;
1143
1144
const res = await exec_manage_cli ( type , action , account_options ) ;
1145
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1144
1146
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1145
1147
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1146
1148
// added additional properties that we can see with wide option (uid, new_buckets_path)
@@ -1155,6 +1157,7 @@ describe('manage nsfs cli account flow', () => {
1155
1157
const account_options = { config_root, wide : 'true' } ;
1156
1158
const action = ACTIONS . LIST ;
1157
1159
const res = await exec_manage_cli ( type , action , account_options ) ;
1160
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1158
1161
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1159
1162
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1160
1163
// added additional properties that we can see with wide option (uid, new_buckets_path)
@@ -1169,6 +1172,7 @@ describe('manage nsfs cli account flow', () => {
1169
1172
const account_options = { config_root, wide : 'TRUE' } ;
1170
1173
const action = ACTIONS . LIST ;
1171
1174
const res = await exec_manage_cli ( type , action , account_options ) ;
1175
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1172
1176
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1173
1177
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1174
1178
// added additional properties that we can see with wide option (uid, new_buckets_path)
@@ -1183,6 +1187,7 @@ describe('manage nsfs cli account flow', () => {
1183
1187
const account_options = { config_root, wide : 'false' } ;
1184
1188
const action = ACTIONS . LIST ;
1185
1189
const res = await exec_manage_cli ( type , action , account_options ) ;
1190
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1186
1191
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1187
1192
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1188
1193
} ) ;
@@ -1191,6 +1196,7 @@ describe('manage nsfs cli account flow', () => {
1191
1196
const account_options = { config_root, wide : 'FALSE' } ;
1192
1197
const action = ACTIONS . LIST ;
1193
1198
const res = await exec_manage_cli ( type , action , account_options ) ;
1199
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1194
1200
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1195
1201
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1196
1202
} ) ;
@@ -1218,6 +1224,7 @@ describe('manage nsfs cli account flow', () => {
1218
1224
} catch ( e ) {
1219
1225
res = e ;
1220
1226
}
1227
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1221
1228
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1222
1229
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1223
1230
} ) ;
@@ -1226,6 +1233,7 @@ describe('manage nsfs cli account flow', () => {
1226
1233
const account_options = { config_root, uid : 999 } ;
1227
1234
const action = ACTIONS . LIST ;
1228
1235
const res = await exec_manage_cli ( type , action , account_options ) ;
1236
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1229
1237
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1230
1238
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account1' ] ) ) ;
1231
1239
} ) ;
@@ -1234,6 +1242,7 @@ describe('manage nsfs cli account flow', () => {
1234
1242
const account_options = { config_root, gid : 999 } ;
1235
1243
const action = ACTIONS . LIST ;
1236
1244
const res = await exec_manage_cli ( type , action , account_options ) ;
1245
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1237
1246
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1238
1247
. toEqual ( expect . arrayContaining ( [ 'account1' ] ) ) ;
1239
1248
} ) ;
@@ -1242,6 +1251,7 @@ describe('manage nsfs cli account flow', () => {
1242
1251
const account_options = { config_root, uid : 999 , gid : 999 } ;
1243
1252
const action = ACTIONS . LIST ;
1244
1253
const res = await exec_manage_cli ( type , action , account_options ) ;
1254
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1245
1255
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1246
1256
. toEqual ( expect . arrayContaining ( [ 'account1' ] ) ) ;
1247
1257
} ) ;
@@ -1250,6 +1260,7 @@ describe('manage nsfs cli account flow', () => {
1250
1260
const account_options = { config_root, uid : 999 , gid : 888 } ;
1251
1261
const action = ACTIONS . LIST ;
1252
1262
const res = await exec_manage_cli ( type , action , account_options ) ;
1263
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1253
1264
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1254
1265
. toEqual ( expect . arrayContaining ( [ 'account3' ] ) ) ;
1255
1266
} ) ;
@@ -1265,6 +1276,7 @@ describe('manage nsfs cli account flow', () => {
1265
1276
const account_options = { config_root, user : 'root' } ;
1266
1277
const action = ACTIONS . LIST ;
1267
1278
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1279
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1268
1280
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1269
1281
. toEqual ( expect . arrayContaining ( [ 'account4' ] ) ) ;
1270
1282
} ) ;
@@ -1273,6 +1285,7 @@ describe('manage nsfs cli account flow', () => {
1273
1285
const account_options = { config_root, user : 'shaul' } ;
1274
1286
const action = ACTIONS . LIST ;
1275
1287
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1288
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1276
1289
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1277
1290
. toEqual ( [ ] ) ;
1278
1291
} ) ;
@@ -1281,6 +1294,7 @@ describe('manage nsfs cli account flow', () => {
1281
1294
const account_options = { config_root, access_key : 'GIGiFAnjaaE7OKD5N7hA' } ;
1282
1295
const action = ACTIONS . LIST ;
1283
1296
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1297
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1284
1298
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1285
1299
. toEqual ( expect . arrayContaining ( [ 'account1' ] ) ) ;
1286
1300
} ) ;
@@ -1289,14 +1303,25 @@ describe('manage nsfs cli account flow', () => {
1289
1303
const account_options = { config_root, name : 'account3' } ;
1290
1304
const action = ACTIONS . LIST ;
1291
1305
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1306
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1292
1307
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1293
1308
. toEqual ( expect . arrayContaining ( [ 'account3' ] ) ) ;
1294
1309
} ) ;
1295
1310
1311
+ it ( 'cli list filter by name (non-existing-account) - (none)' , async ( ) => {
1312
+ const account_options = { config_root, name : 'non-existing-account' } ;
1313
+ const action = ACTIONS . LIST ;
1314
+ const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1315
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1316
+ expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1317
+ . toEqual ( [ ] ) ;
1318
+ } ) ;
1319
+
1296
1320
it ( 'cli list filter by access key (of account1) and name (of account3) - (none)' , async ( ) => {
1297
1321
const account_options = { config_root, name : 'account3' , access_key : 'GIGiFAnjaaE7OKD5N7hA' } ;
1298
1322
const action = ACTIONS . LIST ;
1299
1323
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1324
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1300
1325
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1301
1326
. toEqual ( [ ] ) ;
1302
1327
} ) ;
@@ -1305,6 +1330,7 @@ describe('manage nsfs cli account flow', () => {
1305
1330
const account_options = { config_root, name : 'account3' , access_key : 'non-existing-access-key' } ;
1306
1331
const action = ACTIONS . LIST ;
1307
1332
const res = await exec_manage_cli ( TYPES . ACCOUNT , action , account_options ) ;
1333
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1308
1334
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1309
1335
. toEqual ( [ ] ) ;
1310
1336
} ) ;
@@ -1320,6 +1346,7 @@ describe('manage nsfs cli account flow', () => {
1320
1346
const account_options = { config_root, wide : true , show_secrets : true } ;
1321
1347
const action = ACTIONS . LIST ;
1322
1348
const res = await exec_manage_cli ( type , action , account_options ) ;
1349
+ expect ( Array . isArray ( JSON . parse ( res ) . response . reply ) ) . toBe ( true ) ;
1323
1350
expect ( JSON . parse ( res ) . response . reply . map ( item => item . name ) )
1324
1351
. toEqual ( expect . arrayContaining ( [ 'account3' , 'account2' , 'account1' ] ) ) ;
1325
1352
const res_arr = JSON . parse ( res ) . response . reply ;
0 commit comments