Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/__tests__/lib/command/util/smartapps-util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ describe('paidPlanRequiredHandler', () => {
it('exits with a helpful message on 403', () => {
expect(() => paidPlanRequiredHandler({ response: { status: 403 } })).toThrow('should exit')

expect(fatalErrorMock).toHaveBeenCalledExactlyOnceWith(
'Creating or modifying a Smart App requires a paid plan. Visit' +
'\n https://developer.smartthings.com/console/service-integrations/manage-plans' +
'\nto upgrade.',
)
expect(fatalErrorMock).toHaveBeenCalledExactlyOnceWith(expect.stringContaining(
'Creating or modifying a Smart App requires a paid plan.',
))
})

it('rethrows other errors', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/command/util/smartapps-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const paidPlanRequiredHandler = (error: unknown): never => {
if ((error as { response?: { status?: number } } | undefined)?.response?.status === 403) {
return fatalError('Creating or modifying a Smart App requires a paid plan. Visit' +
'\n https://developer.smartthings.com/console/service-integrations/manage-plans' +
'\nto upgrade.')
'\nto upgrade.' +
'\n\nMore info can be found at' +
'\n https://developer.smartthings.com/docs/service-integrations/get-started')
}
throw error
}
Expand Down
Loading