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:
Adrien de Peretti
2024-07-21 21:21:05 +02:00
committed by GitHub
parent 2f56030101
commit 566300d54b
7 changed files with 203 additions and 248 deletions
@@ -33,21 +33,13 @@ moduleIntegrationTestRunner<IUserModuleService>({
service: UserModuleService,
}).linkable
expect(Object.keys(linkable)).toEqual(["invite", "user"])
expect(Object.keys(linkable)).toEqual(["user", "invite"])
Object.keys(linkable).forEach((key) => {
delete linkable[key].toJSON
})
expect(linkable).toEqual({
invite: {
id: {
linkable: "invite_id",
primaryKey: "id",
serviceName: "user",
field: "invite",
},
},
user: {
id: {
linkable: "user_id",
@@ -56,6 +48,14 @@ moduleIntegrationTestRunner<IUserModuleService>({
field: "user",
},
},
invite: {
id: {
linkable: "invite_id",
primaryKey: "id",
serviceName: "user",
field: "invite",
},
},
})
})