chore(utils): Add default ordering to the internal service factory list/listAndCount (#6436)

**What**
Default ordering. By default, only the top level entity ordering is applied using the primary keys, the relations are default ordered by the foreign keys.

It include tests fixing for deterministic data ordering
This commit is contained in:
Adrien de Peretti
2024-02-20 11:07:39 +00:00
committed by GitHub
parent 691f68c3b8
commit c319edb8e0
14 changed files with 208 additions and 78 deletions
@@ -43,15 +43,15 @@ describe("AuthModuleService - AuthUser", () => {
const authUsers = await service.list()
expect(authUsers).toEqual([
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "store",
}),
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "manual",
}),
])
})
@@ -89,15 +89,15 @@ describe("AuthModuleService - AuthUser", () => {
expect(count).toEqual(3)
expect(authUsers).toEqual([
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "store",
}),
expect.objectContaining({
provider: "manual",
}),
expect.objectContaining({
provider: "manual",
}),
])
})