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:
@@ -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 },
|
||||
])
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user