-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca59c48
commit 5838b81
Showing
11 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './deletion-request.entity'; | ||
export * from './deletion-log.entity'; |
19 changes: 19 additions & 0 deletions
19
apps/server/src/modules/deletion/entity/testing/deletion-request.entity.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { setupEntities } from '@shared/testing'; | ||
import { DeletionRequestEntity } from '../deletion-request.entity'; | ||
import { deletionRequestEntityFactory } from './factory/deletion-request.entity.factory'; | ||
|
||
describe(DeletionRequestEntity.name, () => { | ||
beforeAll(async () => { | ||
await setupEntities(); | ||
}); | ||
|
||
describe('constructor', () => { | ||
describe('When constructor is called', () => { | ||
it('should create a deletionRequest by passing required properties', () => { | ||
const entity: DeletionRequestEntity = deletionRequestEntityFactory.build(); | ||
|
||
expect(entity instanceof DeletionRequestEntity).toEqual(true); | ||
}); | ||
}); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
apps/server/src/modules/deletion/entity/testing/factory/deletion-request.entity.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ObjectId } from '@mikro-orm/mongodb'; | ||
import { BaseFactory } from '@shared/testing'; | ||
import { DeletionRequestEntity, DeletionRequestEntityProps } from '../..'; | ||
|
||
export const deletionRequestEntityFactory = BaseFactory.define<DeletionRequestEntity, DeletionRequestEntityProps>( | ||
DeletionRequestEntity, | ||
() => { | ||
return { | ||
source: 'shd', | ||
deleteAfter: new Date(), | ||
userId: new ObjectId(), | ||
}; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './classes.repo'; | ||
export * from './deletion-log.repo'; | ||
export * from './deletion-request.repo'; |
2 changes: 1 addition & 1 deletion
2
apps/server/src/modules/deletion/repo/mapper/deletion-log.mapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/server/src/modules/deletion/repo/mapper/deletion-request.mapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters