2023-07-25 11:42:44 +03:00
|
|
|
import assert from 'assert/strict';
|
2023-07-26 09:02:03 +03:00
|
|
|
import {
|
2023-09-15 08:08:38 +03:00
|
|
|
PostDeletedEvent,
|
2023-07-26 09:02:03 +03:00
|
|
|
PostsBulkDestroyedEvent,
|
|
|
|
PostsBulkUnpublishedEvent,
|
|
|
|
PostsBulkFeaturedEvent,
|
2023-08-23 11:39:20 +03:00
|
|
|
PostsBulkUnfeaturedEvent,
|
|
|
|
PostsBulkAddTagsEvent
|
2023-07-26 09:02:03 +03:00
|
|
|
} from '../src/index';
|
2023-07-25 11:42:44 +03:00
|
|
|
|
|
|
|
describe('Post Events', function () {
|
2023-09-15 08:08:38 +03:00
|
|
|
it('Can instantiate PostDeletedEvent', function () {
|
|
|
|
const event = PostDeletedEvent.create({id: 'post-id-1', data: {}});
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.id, 'post-id-1');
|
|
|
|
});
|
|
|
|
|
2023-07-25 11:42:44 +03:00
|
|
|
it('Can instantiate BulkDestroyEvent', function () {
|
|
|
|
const event = PostsBulkDestroyedEvent.create(['1', '2', '3']);
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.data.length, 3);
|
|
|
|
});
|
2023-07-26 09:02:03 +03:00
|
|
|
|
|
|
|
it('Can instantiate PostsBulkUnpublishedEvent', function () {
|
|
|
|
const event = PostsBulkUnpublishedEvent.create(['1', '2', '3']);
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.data.length, 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Can instantiate PostsBulkFeaturedEvent', function () {
|
|
|
|
const event = PostsBulkFeaturedEvent.create(['1', '2', '3']);
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.data.length, 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Can instantiate PostsBulkUnfeaturedEvent', function () {
|
|
|
|
const event = PostsBulkUnfeaturedEvent.create(['1', '2', '3']);
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.data.length, 3);
|
|
|
|
});
|
2023-08-23 11:39:20 +03:00
|
|
|
|
|
|
|
it('Can instantiate PostsBulkAddTagsEvent', function () {
|
|
|
|
const event = PostsBulkAddTagsEvent.create(['1', '2', '3']);
|
|
|
|
assert.ok(event);
|
|
|
|
assert.equal(event.data.length, 3);
|
|
|
|
});
|
2023-07-25 11:42:44 +03:00
|
|
|
});
|