feat(medusa,types): add fulfillment provider list api (#7124)

* feat(medusa,types): add fulfillment provider list api

* chore: remove timestamps
This commit is contained in:
Riqwan Thamir
2024-04-22 19:35:33 +02:00
committed by GitHub
parent 0df523594f
commit 38c971f111
11 changed files with 178 additions and 2 deletions
@@ -0,0 +1,42 @@
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { IFulfillmentModuleService } from "@medusajs/types"
import { medusaIntegrationTestRunner } from "medusa-test-utils/dist"
import { createAdminUser } from "../../../helpers/create-admin-user"
jest.setTimeout(100000)
const env = { MEDUSA_FF_MEDUSA_V2: true }
const adminHeaders = {
headers: { "x-medusa-access-token": "test_token" },
}
medusaIntegrationTestRunner({
env,
testSuite: ({ getContainer, api, dbConnection }) => {
let service: IFulfillmentModuleService
let container
beforeAll(() => {
container = getContainer()
service = container.resolve(ModuleRegistrationName.FULFILLMENT)
})
beforeEach(async () => {
await createAdminUser(dbConnection, adminHeaders, container)
})
describe("GET /admin/fulfillment-providers", () => {
it("should list all fulfillment providers", async () => {
const response = await api.get(
`/admin/fulfillment-providers`,
adminHeaders
)
expect(response.status).toEqual(200)
expect(response.data.fulfillment_providers).toEqual([
{ id: "manual_test-provider", is_enabled: true },
])
})
})
},
})