Skip to content

Commit 57afe40

Browse files
test: 🩹 deploy command unit test update
1 parent 6b18665 commit 57afe40

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

test/unit/commands/app/deploy.test.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ describe("app:deploy", () => {
2121
const cases = {
2222
App: mock.apps[1].name,
2323
Organization: mock.organizations[0].name,
24+
"hosting types": "Custom Hosting",
25+
"app-url": "https://example.com",
2426
};
25-
2627
return (cases as Record<string, any>)[prompt.name];
2728
})
2829
.nock(region.cma, (api) =>
@@ -37,10 +38,26 @@ describe("app:deploy", () => {
3738
data: mock.apps,
3839
})
3940
)
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+
)
4053
.nock(`https://${developerHubBaseUrl}`, (api) =>
4154
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,
4461
})
4562
.reply(200, {
4663
data: mock.apps,
@@ -49,12 +66,9 @@ describe("app:deploy", () => {
4966
.command(["app:deploy"])
5067
.do(({ stdout }) => {
5168
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 })
5670
);
5771
})
58-
.it("should install an organization app");
72+
.it("should deploy the app with custom hosting");
5973
});
6074
});

0 commit comments

Comments
 (0)