Skip to content

Commit

Permalink
specs: notification entity
Browse files Browse the repository at this point in the history
  • Loading branch information
fuuuzz committed Jun 26, 2024
1 parent 4604836 commit 46c6ecf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Domain/Notification/Notification.entity.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { mock, when } from 'ts-mockito';
import { LeaveRequest } from '../HumanResource/Leave/LeaveRequest.entity';
import { Notification, NotificationType } from './Notification.entity';

describe('Notification.entity', () => {
it('testGetters', () => {
const leaveRequest = mock(LeaveRequest);

const notification = new Notification(
NotificationType.POST,
'Notification message',
'd6bd60c1-926a-46ba-bece-bdd80582380a',
leaveRequest
);

expect(notification.getId()).toBe(undefined);
expect(notification.getType()).toBe(NotificationType.POST);
expect(notification.getMessage()).toBe('Notification message');
expect(notification.getResourceId()).toBe(
'd6bd60c1-926a-46ba-bece-bdd80582380a'
);
expect(notification.getLeaveRequest()).toBe(leaveRequest);
expect(notification.getCreatedAt()).toBe(undefined);
});
});

0 comments on commit 46c6ecf

Please sign in to comment.