mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
acccc16614
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.
41 lines
1.3 KiB
TypeScript
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);
|
|
});
|
|
});
|