From 68406b857897d872a40f996ef31ed5d51693aef7 Mon Sep 17 00:00:00 2001 From: Katy Bowman Date: Mon, 11 Mar 2024 17:20:16 -0400 Subject: [PATCH] refactor: update types and test helper function --- packages/cli/src/commands/apps/join.ts | 4 ++-- packages/orgs-v5/test/unit/stub/post.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/apps/join.ts b/packages/cli/src/commands/apps/join.ts index cf6f1334ca..a5334af4e5 100644 --- a/packages/cli/src/commands/apps/join.ts +++ b/packages/cli/src/commands/apps/join.ts @@ -13,11 +13,11 @@ export default class AppsJoin extends Command { }; public async run(): Promise { - const {flags, argv, args} = await this.parse(AppsJoin) + const {flags} = await this.parse(AppsJoin) const {app} = flags ux.action.start(`Joining ${color.cyan(app)}`) const {body: user} = await this.heroku.get('/account') - await this.heroku.post(`/teams/apps/${app}/collaborators`, { + await this.heroku.post(`/teams/apps/${app}/collaborators`, { body: {user: user.email}, }) ux.action.stop() diff --git a/packages/orgs-v5/test/unit/stub/post.js b/packages/orgs-v5/test/unit/stub/post.js index 9cf7293290..f5d112de19 100644 --- a/packages/orgs-v5/test/unit/stub/post.js +++ b/packages/orgs-v5/test/unit/stub/post.js @@ -9,7 +9,7 @@ function collaborators() { }).reply(200) } -function teamAppCollaborators(email = 'raulb@heroku.com', permissions = [], response = {}) { +function teamAppCollaborators(email = 'raulb@heroku.com', permissions = []) { let body = {user: email} if (permissions.length > 0) { body.permissions = permissions @@ -18,7 +18,7 @@ function teamAppCollaborators(email = 'raulb@heroku.com', permissions = [], resp return nock('https://api.heroku.com:443', { reqheaders: {Accept: 'application/vnd.heroku+json; version=3'}, }) - .post('/teams/apps/myapp/collaborators', body).reply(response.code || 200, response.description) + .post('/teams/apps/myapp/collaborators', body).reply(200) } function personalToPersonal() {