fix: normalize path before consuming it while loading models (#8194)
* fix: normalize path before consuming it while loading models * Make it so that models derived from the service if present * fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config * fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config * fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config
This commit is contained in:
@@ -16,10 +16,10 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
||||
}).linkable
|
||||
|
||||
expect(Object.keys(linkable)).toEqual([
|
||||
"taxProvider",
|
||||
"taxRateRule",
|
||||
"taxRate",
|
||||
"taxRegion",
|
||||
"taxRateRule",
|
||||
"taxProvider",
|
||||
])
|
||||
|
||||
Object.keys(linkable).forEach((key) => {
|
||||
@@ -27,22 +27,6 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
||||
})
|
||||
|
||||
expect(linkable).toEqual({
|
||||
taxProvider: {
|
||||
id: {
|
||||
linkable: "tax_provider_id",
|
||||
primaryKey: "id",
|
||||
serviceName: "tax",
|
||||
field: "taxProvider",
|
||||
},
|
||||
},
|
||||
taxRateRule: {
|
||||
id: {
|
||||
linkable: "tax_rate_rule_id",
|
||||
primaryKey: "id",
|
||||
serviceName: "tax",
|
||||
field: "taxRateRule",
|
||||
},
|
||||
},
|
||||
taxRate: {
|
||||
id: {
|
||||
linkable: "tax_rate_id",
|
||||
@@ -59,6 +43,22 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
||||
field: "taxRegion",
|
||||
},
|
||||
},
|
||||
taxRateRule: {
|
||||
id: {
|
||||
linkable: "tax_rate_rule_id",
|
||||
primaryKey: "id",
|
||||
serviceName: "tax",
|
||||
field: "taxRateRule",
|
||||
},
|
||||
},
|
||||
taxProvider: {
|
||||
id: {
|
||||
linkable: "tax_provider_id",
|
||||
primaryKey: "id",
|
||||
serviceName: "tax",
|
||||
field: "taxProvider",
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
@@ -214,15 +214,19 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
||||
},
|
||||
})
|
||||
|
||||
const error = await service.createTaxRegions({
|
||||
country_code: "US",
|
||||
default_tax_rate: {
|
||||
name: "Test Rate",
|
||||
rate: 0.2,
|
||||
},
|
||||
}).catch(e => e)
|
||||
const error = await service
|
||||
.createTaxRegions({
|
||||
country_code: "US",
|
||||
default_tax_rate: {
|
||||
name: "Test Rate",
|
||||
rate: 0.2,
|
||||
},
|
||||
})
|
||||
.catch((e) => e)
|
||||
|
||||
expect(error.message).toEqual("Tax region with country_code: us, already exists.")
|
||||
expect(error.message).toEqual(
|
||||
"Tax region with country_code: us, already exists."
|
||||
)
|
||||
})
|
||||
|
||||
it("should throw when creating a tax region with a country code and province code of an existing region", async () => {
|
||||
@@ -235,18 +239,22 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
||||
},
|
||||
})
|
||||
|
||||
const error = await service.createTaxRegions({
|
||||
country_code: "US",
|
||||
province_code: "CA",
|
||||
default_tax_rate: {
|
||||
name: "Test Rate",
|
||||
rate: 0.2,
|
||||
},
|
||||
}).catch(e => e)
|
||||
const error = await service
|
||||
.createTaxRegions({
|
||||
country_code: "US",
|
||||
province_code: "CA",
|
||||
default_tax_rate: {
|
||||
name: "Test Rate",
|
||||
rate: 0.2,
|
||||
},
|
||||
})
|
||||
.catch((e) => e)
|
||||
|
||||
expect(error.message).toEqual("Tax region with country_code: us, province_code: ca, already exists.")
|
||||
expect(error.message).toEqual(
|
||||
"Tax region with country_code: us, province_code: ca, already exists."
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
it("should create tax rates and update them", async () => {
|
||||
const region = await service.createTaxRegions({
|
||||
country_code: "US",
|
||||
|
||||
Reference in New Issue
Block a user