Repository navigation
test(tree): simplify tree test entities and remove unused fields - #12260
Conversation
Review Summary by QodoSimplify tree test entities and remove unused fields
WalkthroughsDescription• Remove commented-out @TreeLevelColumn decorators from test entities
• Fix UUID entity type mismatch: id: number → id: string
• Simplify @Entity("custom_name") to @Entity() where unnecessary
• Remove redundant decorator options matching TypeORM defaults
• Remove unused created/modified date columns from test entities
• Remove empty @JoinColumn() and redundant referencedColumnName options
Diagramflowchart LR
A["Test Entity Decorators"] -->|Remove commented code| B["Clean entities"]
A -->|Fix UUID type mismatch| B
A -->|Simplify @Entity names| B
A -->|Remove redundant options| B
A -->|Remove unused columns| B
B -->|Cleaner test code| C["Improved maintainability"]
File Changes1. test/functional/tree-tables/closure-table/basic/entity/Category.ts
|
275fd37 to
e3bdf6f
Compare
| parentId: number | ||
|
|
||
| @TreeParent() | ||
| @JoinColumn({ name: "parent_id", referencedColumnName: "id" }) |
There was a problem hiding this comment.
Such options might have had a purpose in the test (e.g. test without inferring the default), I hope you checked :)
There was a problem hiding this comment.
Yes, I checked. This was not relevant for the test scope... Test pass even without this...
|
Code Review by Qodo
1. Union column type lost
|
Code Review by Qodo
1. Nullable fields typed non-null
|



Follow-up to #12259 which was prematurely merged before these cleanups were applied.
@TreeLevelColumn/levellinesid: number→id: stringfor@PrimaryGeneratedColumn("uuid"))@Entity("custom_name")to@Entity()where custom name is not relevant to the testnullable: false,namematching property,referencedColumnName: "id",type: "int"for numbers,type: "varchar"for strings)created/modifieddate columns not referenced in tests)@JoinColumn()where TypeORM auto-creates the join column!and?modifiers from entity propertiestree-tables > <type> > <feature>format (no "basic" suffix)mysql > tree tables > closure-tabletotree-tables > closure-table > closure column metadatait("X > Y", ...)patterns to nesteddescribe/itblocksshould work correctly) with descriptive behavior statements