-
Notifications
You must be signed in to change notification settings - Fork 0
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
8a3b013
commit 4c2737f
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
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,4 +1,6 @@ | ||
export * from './lib/entities/task.entity'; | ||
export * from './lib/entities/user-task.entity'; | ||
|
||
export * from './lib/value-objects/task-status.enum'; | ||
|
||
export * from './lib/tasks.repository'; |
20 changes: 20 additions & 0 deletions
20
libs/tasks/domain/src/lib/value-objects/task-status.enum.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,20 @@ | ||
import { TaskStatus } from './task-status.enum'; | ||
|
||
describe('TaskStatus', () => { | ||
it('should have TODO status', () => { | ||
expect(TaskStatus.TODO).toBe('TODO'); | ||
}); | ||
|
||
it('should have IN_PROGRESS status', () => { | ||
expect(TaskStatus.IN_PROGRESS).toBe('IN_PROGRESS'); | ||
}); | ||
|
||
it('should have DONE status', () => { | ||
expect(TaskStatus.DONE).toBe('DONE'); | ||
}); | ||
|
||
it('should be immutable', () => { | ||
// @ts-expect-error - Testing immutability | ||
expect(() => TaskStatus.TODO = 'SOMETHING_ELSE').toThrow(); | ||
}); | ||
}); |
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,7 @@ | ||
export const TaskStatusEnum = { | ||
TODO: 'TODO', | ||
IN_PROGRESS: 'IN_PROGRESS', | ||
DONE: 'DONE', | ||
} as const; | ||
|
||
export type TaskStatus = (typeof TaskStatusEnum)[keyof typeof TaskStatusEnum]; |