|
1 | 1 | import Notification from '@/entities/Notification';
|
| 2 | +import Constants from '@/Constants'; |
2 | 3 |
|
3 | 4 | describe('entities/Notification', () => {
|
4 | 5 | let notification;
|
@@ -76,20 +77,20 @@ describe('entities/Notification', () => {
|
76 | 77 | });
|
77 | 78 |
|
78 | 79 | it('check "events" property setters/getters', () => {
|
79 |
| - notification.setProperty('events', 'CREATE_LICENSEE,CREATE_LICENSE'); |
80 |
| - expect(notification.getProperty('events')).toBe('CREATE_LICENSEE,CREATE_LICENSE'); |
81 |
| - expect(notification.getEvents()).toBe('CREATE_LICENSEE,CREATE_LICENSE'); |
82 |
| - expect(notification.events).toBe('CREATE_LICENSEE,CREATE_LICENSE'); |
83 |
| - |
84 |
| - notification.setEvents('CREATE_LICENSEE'); |
85 |
| - expect(notification.getProperty('events')).toBe('CREATE_LICENSEE'); |
86 |
| - expect(notification.getEvents()).toBe('CREATE_LICENSEE'); |
87 |
| - expect(notification.events).toBe('CREATE_LICENSEE'); |
88 |
| - |
89 |
| - notification.events = 'CREATE_LICENSE'; |
90 |
| - expect(notification.getProperty('events')).toBe('CREATE_LICENSE'); |
91 |
| - expect(notification.getEvents()).toBe('CREATE_LICENSE'); |
92 |
| - expect(notification.events).toBe('CREATE_LICENSE'); |
| 80 | + notification.setProperty('events', 'LICENSEE_CREATED,LICENSE_CREATED'); |
| 81 | + expect(notification.getProperty('events')).toBe('LICENSEE_CREATED,LICENSE_CREATED'); |
| 82 | + expect(notification.getEvents()).toBe('LICENSEE_CREATED,LICENSE_CREATED'); |
| 83 | + expect(notification.events).toBe('LICENSEE_CREATED,LICENSE_CREATED'); |
| 84 | + |
| 85 | + notification.setEvents('LICENSEE_CREATED'); |
| 86 | + expect(notification.getProperty('events')).toBe('LICENSEE_CREATED'); |
| 87 | + expect(notification.getEvents()).toBe('LICENSEE_CREATED'); |
| 88 | + expect(notification.events).toBe('LICENSEE_CREATED'); |
| 89 | + |
| 90 | + notification.events = 'LICENSE_CREATED'; |
| 91 | + expect(notification.getProperty('events')).toBe('LICENSE_CREATED'); |
| 92 | + expect(notification.getEvents()).toBe('LICENSE_CREATED'); |
| 93 | + expect(notification.events).toBe('LICENSE_CREATED'); |
93 | 94 | });
|
94 | 95 |
|
95 | 96 | it('check "payload" property setters/getters', () => {
|
@@ -159,4 +160,10 @@ describe('entities/Notification', () => {
|
159 | 160 | expect(notification.getProperty('number')).toBe('number');
|
160 | 161 | expect(notification.getNumber()).toBe('number');
|
161 | 162 | });
|
| 163 | + |
| 164 | + it('check events', () => { |
| 165 | + expect(Constants.Notification.Event.LICENSEE_CREATED).toBe('LICENSEE_CREATED'); |
| 166 | + expect(Constants.Notification.Event.LICENSE_CREATED).toBe('LICENSE_CREATED'); |
| 167 | + expect(Constants.Notification.Event.WARNING_LEVEL_CHANGED).toBe('WARNING_LEVEL_CHANGED'); |
| 168 | + }); |
162 | 169 | });
|
0 commit comments