mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
Refactor entity handling to preserve config while overriding type
Reworked `ensureEntity` to replace entities while maintaining their configuration and allowing type adjustments. Updated tests to verify type persistence and synchronization of entity properties.
This commit is contained in:
@@ -121,15 +121,10 @@ describe("AppAuth", () => {
|
||||
|
||||
await app.build();
|
||||
|
||||
const userfields = app.modules.em.entity("users").fields.map((f) => f.name);
|
||||
expect(userfields).toContain("additional");
|
||||
expect(userfields).toEqual([
|
||||
"id",
|
||||
"additional",
|
||||
"email",
|
||||
"strategy",
|
||||
"strategy_value",
|
||||
"role"
|
||||
]);
|
||||
const e = app.modules.em.entity("users");
|
||||
const fields = e.fields.map((f) => f.name);
|
||||
expect(e.type).toBe("system");
|
||||
expect(fields).toContain("additional");
|
||||
expect(fields).toEqual(["id", "email", "strategy", "strategy_value", "role", "additional"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user