@@ -459,24 +459,23 @@ describe('ProjectManagement', () => {
459459 + `Response data: ${ JSON . stringify ( partialApiResponse , null , 2 ) } ` ) ;
460460 } ) ;
461461
462- it ( 'should throw with API response with invalid "apps[].platform" field' , ( ) => {
463- const invalidPlatformApiResponse = {
462+ it ( 'should throw with API response missing "apps[].platform" field' , ( ) => {
463+ const missingPlatformApiResponse = {
464464 apps : [ {
465465 appId : APP_ID ,
466- platform : 'INVALID' ,
467466 } ] ,
468467 } ;
469468
470469 const stub = sinon
471470 . stub ( ProjectManagementRequestHandler . prototype , 'listAppMetadata' )
472- . returns ( Promise . resolve ( invalidPlatformApiResponse ) ) ;
471+ . returns ( Promise . resolve ( missingPlatformApiResponse ) ) ;
473472 stubs . push ( stub ) ;
474473 return projectManagement . listAppMetadata ( )
475474 . should . eventually . be . rejected
476475 . and . have . property (
477476 'message' ,
478- '"apps[].platform" field must be one of [PLATFORM_UNKNOWN, IOS, ANDROID] . '
479- + `Response data: ${ JSON . stringify ( invalidPlatformApiResponse , null , 2 ) } ` ) ;
477+ '"apps[].platform" field must be present in the listAppMetadata() response data . '
478+ + `Response data: ${ JSON . stringify ( missingPlatformApiResponse , null , 2 ) } ` ) ;
480479 } ) ;
481480
482481 it ( 'should resolve with list of apps metadata on success' , ( ) => {
@@ -489,6 +488,26 @@ describe('ProjectManagement', () => {
489488 return projectManagement . listAppMetadata ( )
490489 . should . eventually . deep . equal ( validAppMetadata ) ;
491490 } ) ;
491+
492+ it ( 'should resolve with "apps[].platform" to be "PLATFORM_UNKNOWN" for web app' , ( ) => {
493+ const webPlatformApiResponse = {
494+ apps : [ {
495+ appId : APP_ID ,
496+ platform : 'WEB' ,
497+ } ] ,
498+ } ;
499+ const expectedAppMetadata : AppMetadata [ ] = [ {
500+ appId : APP_ID ,
501+ platform : AppPlatform . PLATFORM_UNKNOWN ,
502+ } ] ;
503+
504+ const stub = sinon
505+ . stub ( ProjectManagementRequestHandler . prototype , 'listAppMetadata' )
506+ . returns ( Promise . resolve ( webPlatformApiResponse ) ) ;
507+ stubs . push ( stub ) ;
508+ return projectManagement . listAppMetadata ( )
509+ . should . eventually . deep . equal ( expectedAppMetadata ) ;
510+ } ) ;
492511 } ) ;
493512
494513 describe ( 'setDisplayName' , ( ) => {
0 commit comments