fix: Tax region + rates clean up (#9279)
What - Require `code` on Tax Rates - Update dashboard to account for non-nullable code on Tax Rates - Include `automatic_taxes` in API Route response Closes CC-524 CC-525
This commit is contained in:
@@ -234,6 +234,29 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
})
|
||||
|
||||
it("should fail to create a tax rate without a code", async () => {
|
||||
const errResponse = await api
|
||||
.post(
|
||||
`/admin/tax-regions`,
|
||||
{
|
||||
country_code: "us",
|
||||
default_tax_rate: {
|
||||
rate: 2,
|
||||
name: "default rate",
|
||||
},
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
.catch((e) => e)
|
||||
|
||||
expect(errResponse.response.status).toEqual(400)
|
||||
expect(errResponse.response.data).toEqual({
|
||||
message:
|
||||
"Invalid request: Field 'default_tax_rate, code' is required",
|
||||
type: "invalid_data",
|
||||
})
|
||||
})
|
||||
|
||||
it("can create a tax rate and update it", async () => {
|
||||
const regionRes = await api.post(
|
||||
`/admin/tax-regions`,
|
||||
|
||||
Reference in New Issue
Block a user