Skip to content

Commit 02685dd

Browse files
fix: updated unit test cases accordingly
1 parent 8ddb363 commit 02685dd

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

test/unit/commands/app/delete.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ describe("app:delete", () => {
1717
.stdout({ print: process.env.PRINT === "true" || false })
1818
.stub(ux.action, "stop", () => {})
1919
.stub(ux.action, "start", () => {})
20+
.stub(cliux, "inquire", async (...args: any) => {
21+
const [prompt]: any = args;
22+
const cases = {
23+
confirmation: true,
24+
};
25+
26+
return (cases as Record<string, any>)[prompt.name];
27+
})
2028
.nock(region.cma, (api) =>
2129
api
2230
.get("/v3/organizations?limit=100&asc=name&include_count=true&skip=0")
@@ -46,7 +54,8 @@ describe("app:delete", () => {
4654
const [prompt]: any = args;
4755
const cases = {
4856
Organization: 'test org 1',
49-
App: 'App 1'
57+
App: 'App 1',
58+
confirmation: true
5059
}
5160
return (cases as Record<string, any>)[prompt.name];
5261
})
@@ -93,7 +102,8 @@ describe("app:delete", () => {
93102
const [prompt]: any = args;
94103
const cases = {
95104
Organization: 'test org 1',
96-
App: 'App 1'
105+
App: 'App 1',
106+
confirmation: true
97107
}
98108
return (cases as Record<string, any>)[prompt.name];
99109
})

test/unit/commands/app/get.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe("app:get", () => {
119119

120120
return (cases as Record<string, any>)[prompt.name];
121121
})
122-
.stub(cliux, "confirm", async () => true)
122+
.stub(cliux, "confirm", async () => false)
123123
.nock(region.cma, (api) =>
124124
api
125125
.get("/v3/organizations?limit=100&asc=name&include_count=true&skip=0")
@@ -171,7 +171,7 @@ describe("app:get", () => {
171171

172172
return (cases as Record<string, any>)[prompt.name];
173173
})
174-
.stub(cliux, "confirm", async () => false)
174+
.stub(cliux, "confirm", async () => true)
175175
.nock(region.cma, (api) =>
176176
api
177177
.get("/v3/organizations?limit=100&asc=name&include_count=true&skip=0")

0 commit comments

Comments
 (0)