Ghost/ghost/post-events/test/post-events.test.ts
Naz 18a4fa8cd9 Added bulk posts action events dispatching
refs https://github.com/TryGhost/Arch/issues/16

- Allows to subscribe to bulk unpublish/featured/unfeatured DomainEvents elsewhere in the system, for example, Collections.
2023-08-01 15:11:00 +08:00

34 lines
1.1 KiB
TypeScript

import assert from 'assert/strict';
import {
PostsBulkDestroyedEvent,
PostsBulkUnpublishedEvent,
PostsBulkFeaturedEvent,
PostsBulkUnfeaturedEvent
} from '../src/index';
describe('Post Events', function () {
it('Can instantiate BulkDestroyEvent', function () {
const event = PostsBulkDestroyedEvent.create(['1', '2', '3']);
assert.ok(event);
assert.equal(event.data.length, 3);
});
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);
});
});