@@ -49,19 +49,29 @@ describe('admin.projectManagement', () => {
49
49
50
50
describe ( 'listAndroidApps()' , ( ) => {
51
51
it ( 'successfully lists Android apps' , ( ) => {
52
- return admin . projectManagement ( ) . listAndroidApps ( ) . then ( ( results ) => {
53
- expect ( results . length ) . to . be . at . least ( 1 ) ;
54
- expect ( results [ 0 ] . appId ) . to . equal ( androidApp . appId ) ;
55
- } ) ;
52
+ return admin . projectManagement ( ) . listAndroidApps ( )
53
+ . then ( ( apps ) => Promise . all ( apps . map ( ( app ) => app . getMetadata ( ) ) ) )
54
+ . then ( ( metadatas ) => {
55
+ expect ( metadatas . length ) . to . be . at . least ( 1 ) ;
56
+ const metadataOwnedByTest =
57
+ metadatas . find ( ( metadata ) => isIntegrationTestApp ( metadata . packageName ) ) ;
58
+ expect ( metadataOwnedByTest ) . to . exist ;
59
+ expect ( metadataOwnedByTest . appId ) . to . equal ( androidApp . appId ) ;
60
+ } ) ;
56
61
} ) ;
57
62
} ) ;
58
63
59
64
describe ( 'listIosApps()' , ( ) => {
60
65
it ( 'successfully lists iOS apps' , ( ) => {
61
- return admin . projectManagement ( ) . listIosApps ( ) . then ( ( results ) => {
62
- expect ( results . length ) . to . be . at . least ( 1 ) ;
63
- expect ( results [ 0 ] . appId ) . to . equal ( iosApp . appId ) ;
64
- } ) ;
66
+ return admin . projectManagement ( ) . listIosApps ( )
67
+ . then ( ( apps ) => Promise . all ( apps . map ( ( app ) => app . getMetadata ( ) ) ) )
68
+ . then ( ( metadatas ) => {
69
+ expect ( metadatas . length ) . to . be . at . least ( 1 ) ;
70
+ const metadataOwnedByTest =
71
+ metadatas . find ( ( metadata ) => isIntegrationTestApp ( metadata . bundleId ) ) ;
72
+ expect ( metadataOwnedByTest ) . to . exist ;
73
+ expect ( metadataOwnedByTest . appId ) . to . equal ( iosApp . appId ) ;
74
+ } ) ;
65
75
} ) ;
66
76
} ) ;
67
77
0 commit comments