* wip: calculated SO pricing in RMA flows * fix: types * chore: small refactor * feat: caluclated shipping in return flow * fix: module integrations * fix: array containing * feat: refresh shipping on update item quantity * rm: log * rm: log2 * feat: update interface, remove flag * fix: revert change on OE for now * fix: import * feat: refactor flwos, cleanup cacluation cotext data model, wip exchanges * feat: refreshing inbound/outbound shipping on items change * feat: refresh exchange shipping on return item add, test * feat: refresh shipping on exchange/return item remove * fix: check optional * feat: test recalculation on quantity update * feat: calculated shipping on claims * fix: comment * wip: address comments * fix: more remote query, fix build * refactor: claim refresh workflow * fix: remove throw option * fix: deconstruct param --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { IFulfillmentModuleService } from "@medusajs/types"
|
|
import { Modules } from "@medusajs/utils"
|
|
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
|
|
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(Modules.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(
|
|
expect.arrayContaining([
|
|
{ id: "manual_test-provider", is_enabled: true },
|
|
{
|
|
id: "manual-calculated_test-provider-calculated",
|
|
is_enabled: true,
|
|
},
|
|
])
|
|
)
|
|
})
|
|
})
|
|
},
|
|
})
|