Skip to content

Commit 2b11301

Browse files
fix(commerce): fix formatTime handling for get-command-execution implementation. fixes #441 (#442)
1 parent 08cbdec commit 2b11301

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/commands/cloudmanager/commerce/get-command-execution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class GetCommandExecutionCommand extends BaseCommand {
4444
},
4545
startedAt: {
4646
header: 'Started At',
47-
get: formatTime(startedAt),
47+
get: formatTime('startedAt'),
4848
},
4949
completedAt: {
5050
header: 'Completed At',
51-
get: formatTime(completedAt),
51+
get: formatTime('completedAt'),
5252
},
5353
status: {},
5454
})

test/commands/commerce/get-command-execution.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ beforeEach(() => {
1919
resetCurrentOrgId()
2020
})
2121

22-
test('get-command (commerce) - missing arg', async () => {
22+
test('get-command-execution (commerce) - missing arg', async () => {
2323
expect.assertions(4)
2424

2525
const runResultOne = GetCommandExecutionCommand.run([])
@@ -34,15 +34,15 @@ test('get-command (commerce) - missing arg', async () => {
3434
)
3535
})
3636

37-
test('get-command (commerce) - missing config', async () => {
37+
test('get-command-execution (commerce) - missing config', async () => {
3838
expect.assertions(2)
3939

4040
const runResult = GetCommandExecutionCommand.run(['--programId', '5', '10', '20'])
4141
await expect(runResult instanceof Promise).toBeTruthy()
4242
await expect(runResult).rejects.toSatisfy(err => err.message === '[CloudManagerCLI:NO_IMS_CONTEXT] Unable to find IMS context aio-cli-plugin-cloudmanager.')
4343
})
4444

45-
test('get-command (commerce)', async () => {
45+
test('get-command-execution (commerce)', async () => {
4646
setCurrentOrgId('good')
4747
mockSdk.getCommerceCommandExecution = jest.fn(() => {
4848
return Promise.resolve({
@@ -59,7 +59,7 @@ test('get-command (commerce)', async () => {
5959
})
6060
})
6161

62-
// expect.assertions(9)
62+
expect.assertions(9)
6363

6464
const runResult = GetCommandExecutionCommand.run(['--programId', '5', '10', '100'])
6565
await expect(runResult instanceof Promise).toBeTruthy()
@@ -79,7 +79,7 @@ test('get-command (commerce)', async () => {
7979
await expect(cli.action.stop).toHaveBeenCalled()
8080
})
8181

82-
test('get-command (commerce) - api error', async () => {
82+
test('get-command-execution (commerce) - api error', async () => {
8383
setCurrentOrgId('good')
8484
mockSdk.getCommerceCommandExecution = jest.fn(() =>
8585
Promise.reject(new Error('Command failed.')),

0 commit comments

Comments
 (0)