@@ -21,8 +21,9 @@ describe("app:deploy", () => {
21
21
const cases = {
22
22
App : mock . apps [ 1 ] . name ,
23
23
Organization : mock . organizations [ 0 ] . name ,
24
+ "hosting types" : "Custom Hosting" ,
25
+ "app-url" : "https://example.com" ,
24
26
} ;
25
-
26
27
return ( cases as Record < string , any > ) [ prompt . name ] ;
27
28
} )
28
29
. nock ( region . cma , ( api ) =>
@@ -37,10 +38,26 @@ describe("app:deploy", () => {
37
38
data : mock . apps ,
38
39
} )
39
40
)
41
+ . nock ( `https://${ developerHubBaseUrl } ` , ( api ) =>
42
+ api . put ( `/manifests/${ mock . apps [ 1 ] . uid } ` ) . reply ( 200 , {
43
+ data : mock . apps ,
44
+ } )
45
+ )
46
+ . nock ( `https://${ developerHubBaseUrl } ` , ( api ) =>
47
+ api
48
+ . patch ( `/manifests/${ mock . apps [ 1 ] . uid } /hosting/disconnect` )
49
+ . reply ( 200 , {
50
+ data : mock . apps ,
51
+ } )
52
+ )
40
53
. nock ( `https://${ developerHubBaseUrl } ` , ( api ) =>
41
54
api
42
- . post ( `/manifests/${ mock . apps [ 1 ] . uid } /deployments` , {
43
- hosting_type : "Custom hosting" ,
55
+ . put ( `/manifests/${ mock . apps [ 1 ] . uid } /hosting` , {
56
+ hosting : {
57
+ provider : "external" ,
58
+ deployment_url : "https://example.com" ,
59
+ } ,
60
+ uid : mock . apps [ 1 ] . uid ,
44
61
} )
45
62
. reply ( 200 , {
46
63
data : mock . apps ,
@@ -49,12 +66,9 @@ describe("app:deploy", () => {
49
66
. command ( [ "app:deploy" ] )
50
67
. do ( ( { stdout } ) => {
51
68
expect ( stdout ) . to . contain (
52
- $t ( messages . HOSTING_TYPE , {
53
- hosting_type : "Custom Hosting" ,
54
- deployment_url : "https://example.com"
55
- } )
69
+ $t ( messages . APP_DEPLOYED , { app : mock . apps [ 1 ] . name } )
56
70
) ;
57
71
} )
58
- . it ( "should install an organization app" ) ;
72
+ . it ( "should deploy the app with custom hosting " ) ;
59
73
} ) ;
60
74
} ) ;
0 commit comments