Skip to content

Commit

Permalink
NLIC-2200: Notify customer about expirable license end (#61)
Browse files Browse the repository at this point in the history
* add warning level events

* add warning level events

* rename events

---------

Co-authored-by: Viacheslav Rudkovskyi <viachaslau.rudkovski@labs64.de>
  • Loading branch information
v-rudkovskiy and Viacheslav Rudkovskyi authored Dec 18, 2023
1 parent 23c6a40 commit aca1360
Show file tree
Hide file tree
Showing 6 changed files with 2,431 additions and 3,225 deletions.
2,787 changes: 1,193 additions & 1,594 deletions dist/netlicensing-client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/netlicensing-client.min.js

Large diffs are not rendered by default.

2,825 changes: 1,212 additions & 1,613 deletions dist/netlicensing-client.node.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/netlicensing-client.node.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ export default {
WEBHOOK: 'WEBHOOK',
},
Event: {
CREATE_LICENSEE: 'CREATE_LICENSEE',
CREATE_LICENSE: 'CREATE_LICENSE',
LICENSEE_CREATED: 'LICENSEE_CREATED',
LICENSE_CREATED: 'LICENSE_CREATED',
WARNING_LEVEL_CHANGED: 'WARNING_LEVEL_CHANGED',
},
},
};
35 changes: 21 additions & 14 deletions test/specs/entities/Notification.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Notification from '@/entities/Notification';
import Constants from '@/Constants';

describe('entities/Notification', () => {
let notification;
Expand Down Expand Up @@ -76,20 +77,20 @@ describe('entities/Notification', () => {
});

it('check "events" property setters/getters', () => {
notification.setProperty('events', 'CREATE_LICENSEE,CREATE_LICENSE');
expect(notification.getProperty('events')).toBe('CREATE_LICENSEE,CREATE_LICENSE');
expect(notification.getEvents()).toBe('CREATE_LICENSEE,CREATE_LICENSE');
expect(notification.events).toBe('CREATE_LICENSEE,CREATE_LICENSE');

notification.setEvents('CREATE_LICENSEE');
expect(notification.getProperty('events')).toBe('CREATE_LICENSEE');
expect(notification.getEvents()).toBe('CREATE_LICENSEE');
expect(notification.events).toBe('CREATE_LICENSEE');

notification.events = 'CREATE_LICENSE';
expect(notification.getProperty('events')).toBe('CREATE_LICENSE');
expect(notification.getEvents()).toBe('CREATE_LICENSE');
expect(notification.events).toBe('CREATE_LICENSE');
notification.setProperty('events', 'LICENSEE_CREATED,LICENSE_CREATED');
expect(notification.getProperty('events')).toBe('LICENSEE_CREATED,LICENSE_CREATED');
expect(notification.getEvents()).toBe('LICENSEE_CREATED,LICENSE_CREATED');
expect(notification.events).toBe('LICENSEE_CREATED,LICENSE_CREATED');

notification.setEvents('LICENSEE_CREATED');
expect(notification.getProperty('events')).toBe('LICENSEE_CREATED');
expect(notification.getEvents()).toBe('LICENSEE_CREATED');
expect(notification.events).toBe('LICENSEE_CREATED');

notification.events = 'LICENSE_CREATED';
expect(notification.getProperty('events')).toBe('LICENSE_CREATED');
expect(notification.getEvents()).toBe('LICENSE_CREATED');
expect(notification.events).toBe('LICENSE_CREATED');
});

it('check "payload" property setters/getters', () => {
Expand Down Expand Up @@ -159,4 +160,10 @@ describe('entities/Notification', () => {
expect(notification.getProperty('number')).toBe('number');
expect(notification.getNumber()).toBe('number');
});

it('check events', () => {
expect(Constants.Notification.Event.LICENSEE_CREATED).toBe('LICENSEE_CREATED');
expect(Constants.Notification.Event.LICENSE_CREATED).toBe('LICENSE_CREATED');
expect(Constants.Notification.Event.WARNING_LEVEL_CHANGED).toBe('WARNING_LEVEL_CHANGED');
});
});

0 comments on commit aca1360

Please sign in to comment.