@@ -49,19 +49,29 @@ describe('admin.projectManagement', () => {
4949
5050 describe ( 'listAndroidApps()' , ( ) => {
5151 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+ } ) ;
5661 } ) ;
5762 } ) ;
5863
5964 describe ( 'listIosApps()' , ( ) => {
6065 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+ } ) ;
6575 } ) ;
6676 } ) ;
6777
0 commit comments