feat: Support invites in CLI for V2 (#6798)

**What**

- Add invite support to cli for 2.0
- Allow email to be passed upon accepting an invite
This commit is contained in:
Oli Juhl
2024-03-26 21:02:56 +01:00
committed by GitHub
parent 16860cc883
commit 0b23e7efb8
8 changed files with 98 additions and 85 deletions
@@ -1,33 +0,0 @@
import { createAdminUser } from "../../../helpers/create-admin-user"
import { medusaIntegrationTestRunner } from "medusa-test-utils"
jest.setTimeout(50000)
const env = { MEDUSA_FF_MEDUSA_V2: true }
const adminHeaders = {
headers: { "x-medusa-access-token": "test_token" },
}
medusaIntegrationTestRunner({
env,
testSuite: ({ dbConnection, getContainer, api }) => {
describe("POST /admin/users", () => {
beforeEach(async () => {
await createAdminUser(dbConnection, adminHeaders, getContainer())
})
it("create a user", async () => {
const body = {
email: "test_member@test.com",
}
const response = await api.post(`/admin/users`, body, adminHeaders)
expect(response.status).toEqual(200)
expect(response.data).toEqual({
user: expect.objectContaining(body),
})
})
})
},
})