Skip to content

Commit

Permalink
Relationship with authority - tests...
Browse files Browse the repository at this point in the history
whether there's a bug
  • Loading branch information
OmarHawk committed Dec 22, 2023
1 parent c37ed37 commit 20bcc66
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions jdl/__test-files__/big_sample.jdl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ entity Region {
name String
}

entity AuthorityExtension {
name String
description String
}

relationship OneToOne {
@id Department{location} to @id(42) Location
}
Expand Down Expand Up @@ -95,6 +100,7 @@ relationship ManyToMany {
JobHistory{job} to Job{history},
JobHistory{emp(employee)} to Employee{jobHistory},
Job{chore(title)} to Task{linkedJob(JobTitle)}
AuthorityExtension{authority(name)} to Authority with builtInEntity
}

paginate JobHistory, Employee with infinite-scroll
Expand Down
5 changes: 5 additions & 0 deletions jdl/jdl-importer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ entity A
relationship OneToMany {
A{user} to User with builtInEntity
}
entity AuthorityExtension
relationship ManyToMany {
AuthorityExtension{authority} to Authority with builtInEntity
}
`,
{ applicationName: 'MyApp', databaseType: databaseTypes.SQL },
).import();
jestExpect(importState.exportedEntities[0].relationships[0].relationshipWithBuiltInEntity).toBe(true);
jestExpect(importState.exportedEntities[1].relationships[0].relationshipWithBuiltInEntity).toBe(true);
});
});
describe('when not parsing applications', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ entity Region {
name String
}

entity AuthorityExtension {
name String
description String
}

relationship OneToOne {
Department{location} to Location,
Employee{user(login)} to @Id User with builtInEntity
Expand Down Expand Up @@ -167,7 +172,8 @@ relationship ManyToMany {
JobHistory{department} to Department{history},
JobHistory{job} to Job{history},
JobHistory{emp(firstName)} to Employee{history},
Job{chore(title)} to Task{linkedJob(title)}
Job{chore(title)} to Task{linkedJob(title)},
AuthorityExtension{authority(name)} to Authority with builtInEntity
}

dto BankAccount, Employee, Department, Location, Country, Region, SilverBadge, GoldenBadge, Identifier with mapstruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ entity Region {
name String
}

entity AuthorityExtension {
name String
description String
}

relationship OneToOne {
Department{location} to Location,
Employee{user(login)} to @Id User with builtInEntity
Expand Down Expand Up @@ -168,7 +173,8 @@ relationship ManyToMany {
JobHistory{department} to Department{history},
JobHistory{job} to Job{history},
JobHistory{emp(firstName)} to Employee{history},
Job{chore(title)} to Task{linkedJob(title)}
Job{chore(title)} to Task{linkedJob(title)},
AuthorityExtension{authority(name)} to Authority with builtInEntity
}

dto BankAccount, Employee, Department, Location, Country, Region, SilverBadge, GoldenBadge, Identifier with mapstruct
Expand Down

0 comments on commit 20bcc66

Please sign in to comment.