Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancbahan committed Jul 5, 2023
1 parent 3330181 commit 68b43b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/app/src/cli/services/app/config/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ describe('pushConfig', () => {
webhookApiVersion: '04-2023',
})

expect(vi.mocked(partnersRequest).mock.calls[2]![2]!).toEqual({
apiKey: '12345',
})

expect(renderSuccess).toHaveBeenCalledWith({
headline: 'Updated app configuration for my app',
body: ['shopify.app.development.toml configuration is now live on Shopify.'],
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/services/app/config/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function pushConfig({configuration, configurationPath}: Options) {
if (usesLegacyScopesBehavior(configuration)) {
const clearResult: ClearScopesSchema = await partnersRequest(clearRequestedScopes, token, {apiKey: app.apiKey})

if (clearResult.appRequestedAccessScopesClear.userErrors.length > 0) {
if (clearResult.appRequestedAccessScopesClear?.userErrors?.length > 0) {
const errors = result.appUpdate.userErrors.map((error) => error.message).join(', ')
abort(errors)
}
Expand Down

0 comments on commit 68b43b5

Please sign in to comment.