Make tests run again
This commit is contained in:
@@ -111,7 +111,7 @@ describe('Eventlog', function () {
|
||||
it('cleans up', async function () {
|
||||
await eventlog._clear();
|
||||
|
||||
for (const e of [ 'persistent.event', 'transient.event', 'anothertransient.event', 'anotherpersistent.event' ]) {
|
||||
for (const e of [ eventlog.ACTION_USER_LOGIN, eventlog.ACTION_USER_LOGIN_GHOST, eventlog.ACTION_USER_LOGOUT, eventlog.ACTION_USER_LOGIN ]) {
|
||||
const eventId = await eventlog.add(e, { ip: '1.2.3.4' }, { appId: 'thatapp' });
|
||||
|
||||
await notifications._add(eventId, 'title', 'some message');
|
||||
@@ -119,14 +119,14 @@ describe('Eventlog', function () {
|
||||
|
||||
await delay(3000);
|
||||
|
||||
const id = await eventlog.add('some.event', { ip: '1.2.3.4' }, { appId: 'thatapp' });
|
||||
const id = await eventlog.add(eventlog.ACTION_USER_LOGIN, { ip: '1.2.3.4' }, { appId: 'thatapp' });
|
||||
|
||||
await eventlog.cleanup({ creationTime: new Date(Date.now() - 1000) }); // 1 second ago
|
||||
let results = await eventlog.listPaged([], null, 1, 100);
|
||||
expect(results.length).to.be(1);
|
||||
|
||||
expect(results[0].id).to.be(id);
|
||||
expect(results[0].action).to.be('some.event');
|
||||
expect(results[0].action).to.be(eventlog.ACTION_USER_LOGIN);
|
||||
expect(results[0].creationTime).to.be.a(Date);
|
||||
|
||||
results = await notifications.list({}, 1, 10);
|
||||
|
||||
Reference in New Issue
Block a user