Ghost/ghost/post-events/test/post-events.test.ts
Naz acccc16614 Added collections update after bulk adding tags
refs https://github.com/TryGhost/Arch/issues/77

- During initial development we have missed to support collections update when tags are added to posts in bulk. It's especially valid usecase since we can define automatic collection with a filter containing not yet existing tags.
2023-08-23 17:12:08 +08:00

41 lines
1.3 KiB
TypeScript

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