Skip to content

Commit 6ec2af4

Browse files
sungmparrossiam
authored andcommitted
fix: correct capability presentation examples
1 parent db83bb0 commit 6ec2af4

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

‎.changeset/cute-hornets-sleep.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smartthings/cli": patch
3+
---
4+
5+
Correct the capability presentation help examples to use the registered command name.

‎src/__tests__/commands/capabilities/presentation.test.ts‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,26 @@ test('builder', () => {
8686
expect(capabilityIdOrIndexBuilderMock).toHaveBeenCalledExactlyOnceWith(apiOrganizationCommandBuilderArgvMock)
8787
expect(formatAndWriteItemBuilderMock).toHaveBeenCalledExactlyOnceWith(capabilityIdOrIndexBuilderArgvMock)
8888

89-
expect(exampleMock).toHaveBeenCalledTimes(1)
89+
expect(exampleMock).toHaveBeenCalledExactlyOnceWith([
90+
[
91+
'$0 capabilities:presentation',
92+
'prompt for a capability and display its presentation information',
93+
],
94+
[
95+
'$0 capabilities:presentation --namespace cathappy12345',
96+
'prompt for a capability from the specified namespace and display its' +
97+
' presentation information',
98+
],
99+
[
100+
'$0 capabilities:presentation cathappy12345.myCapability',
101+
'display details for a capability by id',
102+
],
103+
[
104+
'$0 capabilities:presentation 1',
105+
'display presentation information for the first capability in the list retrieved' +
106+
' by running "smartthings capabilities"',
107+
],
108+
])
90109
expect(optionMock).toHaveBeenCalledTimes(1)
91110
expect(buildEpilogMock).toHaveBeenCalledTimes(1)
92111
expect(epilogMock).toHaveBeenCalledTimes(1)

‎src/commands/capabilities/presentation.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ export const builder = (yargs: Argv): Argv<CommandArgs> =>
4040
})
4141
.example([
4242
[
43-
'$0 capabilities:presentations',
43+
'$0 capabilities:presentation',
4444
'prompt for a capability and display its presentation information',
4545
],
4646
[
47-
'$0 capabilities:presentations --namespace cathappy12345',
47+
'$0 capabilities:presentation --namespace cathappy12345',
4848
'prompt for a capability from the specified namespace and display its' +
4949
' presentation information',
5050
],
5151
[
52-
'$0 capabilities:presentations cathappy12345.myCapability',
52+
'$0 capabilities:presentation cathappy12345.myCapability',
5353
'display details for a capability by id',
5454
],
5555
[
56-
'$0 capabilities:presentations 1',
56+
'$0 capabilities:presentation 1',
5757
'display presentation information for the first capability in the list retrieved' +
5858
' by running "smartthings capabilities"',
5959
],

0 commit comments

Comments
 (0)