fix(modules-sdk): Remote Query "order" as config options (#6925)
This commit is contained in:
committed by
GitHub
parent
4f88743591
commit
dd35a4dbff
@@ -1,5 +1,5 @@
|
||||
import { createAdminUser } from "../../../../helpers/create-admin-user"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
import { createAdminUser } from "../../../../helpers/create-admin-user"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -41,6 +41,18 @@ medusaIntegrationTestRunner({
|
||||
listResp.data.currencies.find((c) => c.code === "aud")
|
||||
)
|
||||
})
|
||||
|
||||
it("should correctly list currencies in the correct order", async () => {
|
||||
const listResp = await api.get(
|
||||
"/admin/currencies?order=-code",
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
const first = listResp.data.currencies.shift()
|
||||
expect(first).toEqual(
|
||||
expect.objectContaining({ code: "zwl", name: "Zimbabwean Dollar" })
|
||||
)
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -798,7 +798,7 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
|
||||
response = await api.get(
|
||||
`/admin/promotions/rule-value-options/rules/currency?limit=2`,
|
||||
`/admin/promotions/rule-value-options/rules/currency?limit=2&order=name`,
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
@@ -806,14 +806,8 @@ medusaIntegrationTestRunner({
|
||||
expect(response.data.values.length).toEqual(2)
|
||||
expect(response.data.values).toEqual(
|
||||
expect.arrayContaining([
|
||||
{
|
||||
label: "United Arab Emirates Dirham",
|
||||
value: "aed",
|
||||
},
|
||||
{
|
||||
label: "Afghan Afghani",
|
||||
value: "afn",
|
||||
},
|
||||
{ label: "Afghan Afghani", value: "afn" },
|
||||
{ label: "Albanian Lek", value: "all" },
|
||||
])
|
||||
)
|
||||
|
||||
@@ -862,8 +856,8 @@ medusaIntegrationTestRunner({
|
||||
expect(response.data.values.length).toEqual(2)
|
||||
expect(response.data.values).toEqual(
|
||||
expect.arrayContaining([
|
||||
{ label: "Andorra", value: "ad" },
|
||||
{ label: "United Arab Emirates", value: "ae" },
|
||||
{ label: "Afghanistan", value: "af" },
|
||||
{ label: "Albania", value: "al" },
|
||||
])
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user