From 6ab6bfa715926a6ed9b0fcdc894647ca41737415 Mon Sep 17 00:00:00 2001 From: Timothy Koech Date: Thu, 9 Jul 2026 13:29:37 +0300 Subject: [PATCH 1/4] feat: add isPublished field to story localisations and update related services --- .../factories/story_localisation_factory.ts | 1 + src/backend/models/story_localisation.ts | 4 + src/backend/services/story_service.ts | 36 +++-- src/backend/stubs/commands/seed_stories.stub | 1 + .../stubs/controllers/stories_controller.stub | 38 ++++-- src/backend/stubs/migrations/stories.stub | 6 + .../stubs/tests/unit/story_service.stub | 128 ++++++++++++++++++ 7 files changed, 191 insertions(+), 23 deletions(-) diff --git a/src/backend/factories/story_localisation_factory.ts b/src/backend/factories/story_localisation_factory.ts index a212f077..17a4aea4 100644 --- a/src/backend/factories/story_localisation_factory.ts +++ b/src/backend/factories/story_localisation_factory.ts @@ -7,6 +7,7 @@ export const StoryLocalisationFactory = factory return { locale: 'en', // storyId: 1, + isPublished: true, title: faker.lorem.sentence(), coverImage: faker.image.url(), description: faker.lorem.paragraph(), diff --git a/src/backend/models/story_localisation.ts b/src/backend/models/story_localisation.ts index 582b9415..3eaf665b 100644 --- a/src/backend/models/story_localisation.ts +++ b/src/backend/models/story_localisation.ts @@ -20,6 +20,9 @@ export default class StoryLocalisation extends BaseModel { @column() declare storyId: number; + @column() + declare isPublished: boolean; + @column() declare title: string; @@ -55,6 +58,7 @@ export default class StoryLocalisation extends BaseModel { } export const emptyTranslation: Partial = { + isPublished: false, title: '', coverImage: '', description: '', diff --git a/src/backend/services/story_service.ts b/src/backend/services/story_service.ts index e29ce19a..8816c5c2 100644 --- a/src/backend/services/story_service.ts +++ b/src/backend/services/story_service.ts @@ -53,10 +53,12 @@ export class StoryService { public async blockingPublishMessages( story: Story, metadata?: StoryPublishMetadata, + locale?: string, ): Promise { - const sourceChapters = await Chapter.query() + const publishLocale = locale ?? this.config.languages[0].locale; + const localeChapters = await Chapter.query() .where('storyId', story.id) - .where('locale', this.config.languages[0].locale); + .where('locale', publishLocale); const messages: string[] = []; @@ -68,7 +70,7 @@ export class StoryService { ); const chapterMessage = publishBlockedMessage( - sourceChapters?.length ?? 0, + localeChapters?.length ?? 0, story.chapterLimit, metadata?.chapterType ?? story.chapterType, metadata?.storyType ?? story.storyType, @@ -86,7 +88,14 @@ export class StoryService { const collected: string[] = []; const story = await Story.query().where('id', storyId).first(); if (!story) collected.push('Story not found.'); - if (story?.isPublished) collected.push('Story is published.'); + + const publishedLocalisation = await StoryLocalisation.query() + .where('storyId', storyId) + .where('isPublished', true) + .first(); + if (publishedLocalisation || story?.isPublished) { + collected.push('Story is published.'); + } const chapters = await Chapter.query().where('storyId', storyId); if (chapters.length > 0) collected.push('Story has published chapters.'); @@ -191,7 +200,7 @@ export class StoryService { visibility: story.visibility, slug: story.slug, template: story.template, - isPublished: story.isPublished, + isPublished: this.localisationIsPublished(target), ...targetFields, resources: await resourceService.hydrate(target.resources ?? []), }, @@ -252,7 +261,7 @@ export class StoryService { sectionType: story.sectionType ?? null, visibility: story.visibility, resources: target.resources ?? [], - isPublished: story.isPublished, + isPublished: this.localisationIsPublished(target), }; } @@ -364,7 +373,7 @@ export class StoryService { description: local?.description ?? source?.description ?? '', coverImage: local?.coverImage || (source?.coverImage ?? ''), chapterLimit: story.chapterLimit, - isPublished: story.isPublished, + isPublished: this.localisationIsPublished(local), createdAt: story.createdAt?.toISO() ?? '', updatedAt: story.updatedAt?.toISO() ?? '', liveCount: index?.publishedList.length ?? 0, @@ -433,12 +442,18 @@ export class StoryService { storyType: story.storyType ?? '', visibility: story.visibility, schemaVersion: 1, - isPublished: story.isPublished, + isPublished: this.localisationIsPublished(localisation), fields: this.fieldsFromTemplate(story.template), sections: localisation?.sections ?? [], }; } + protected localisationIsPublished( + localisation?: Pick | Partial | null, + ): boolean { + return localisation?.isPublished === true; + } + private localisationFields(local: { title?: string | null; coverImage?: string | null; @@ -489,7 +504,10 @@ export class StoryService { const storyModels = await Story.query() .preload('localisations', (localisationsQuery) => { - localisationsQuery.where('locale', locale); + localisationsQuery.where('locale', locale).where('isPublished', true); + }) + .whereHas('localisations', (localisationsQuery) => { + localisationsQuery.where('locale', locale).where('isPublished', true); }) .orderBy('order', 'asc'); diff --git a/src/backend/stubs/commands/seed_stories.stub b/src/backend/stubs/commands/seed_stories.stub index 02c09d76..c6d5dfbb 100644 --- a/src/backend/stubs/commands/seed_stories.stub +++ b/src/backend/stubs/commands/seed_stories.stub @@ -44,6 +44,7 @@ export default class SeedStories extends BaseCommand { await story.related('localisations').create({ locale: 'en', + isPublished: true, title: spec.name, coverImage: spec.coverImage, description: spec.description, diff --git a/src/backend/stubs/controllers/stories_controller.stub b/src/backend/stubs/controllers/stories_controller.stub index eba094b6..f2bfe2c1 100644 --- a/src/backend/stubs/controllers/stories_controller.stub +++ b/src/backend/stubs/controllers/stories_controller.stub @@ -88,6 +88,7 @@ export default class StoriesController { const local = new StoryLocalisation().fill({ storyId: story.id, locale: locale, + isPublished: false, title: payload.title, coverImage: payload.coverImage, description: payload.description, @@ -126,13 +127,17 @@ export default class StoriesController { const story = await Story.findOrFail(version.storyId); if (payload.isPublished) { - const messages = await storyService.blockingPublishMessages(story, { - title: payload.title, - coverImage: payload.coverImage, - storyType: payload.storyType, - chapterType: payload.chapterType, - visibility: payload.visibility, - }); + const messages = await storyService.blockingPublishMessages( + story, + { + title: payload.title, + coverImage: payload.coverImage, + storyType: payload.storyType, + chapterType: payload.chapterType, + visibility: payload.visibility, + }, + version.locale, + ); if (messages.length > 0) { ctx.session.flash('errorsBag', { other: messages.join(' | ') }); return ctx.response.redirect().back(); @@ -161,13 +166,17 @@ export default class StoriesController { payload.isPublished = true; const model = await Story.findOrFail(version.storyId); - const messages = await storyService.blockingPublishMessages(model, { - title: payload.title, - coverImage: payload.coverImage, - storyType: payload.storyType, - chapterType: payload.chapterType, - visibility: payload.visibility, - }); + const messages = await storyService.blockingPublishMessages( + model, + { + title: payload.title, + coverImage: payload.coverImage, + storyType: payload.storyType, + chapterType: payload.chapterType, + visibility: payload.visibility, + }, + version.locale, + ); if (messages.length > 0) { ctx.session.flash('errorsBag', { other: messages.join(' | ') }); return ctx.response.redirect().back(); @@ -218,6 +227,7 @@ export default class StoriesController { } const localisationData = { + isPublished: payload.isPublished, title: payload.title, coverImage: payload.coverImage ?? '', description: payload.description ?? '', diff --git a/src/backend/stubs/migrations/stories.stub b/src/backend/stubs/migrations/stories.stub index 68652ed5..7f12278a 100644 --- a/src/backend/stubs/migrations/stories.stub +++ b/src/backend/stubs/migrations/stories.stub @@ -78,6 +78,12 @@ export default class extends BaseSchema { table.integer('story_id').unsigned().references('stories.id'); + table + .boolean('is_published') + .notNullable() + .defaultTo(false) + .comment('whether this language edition of the story is published'); + table.string('title').notNullable(); table.string('cover_image').nullable().comment('url to the cover image'); diff --git a/src/backend/stubs/tests/unit/story_service.stub b/src/backend/stubs/tests/unit/story_service.stub index b10f00fa..acb4ac1b 100644 --- a/src/backend/stubs/tests/unit/story_service.stub +++ b/src/backend/stubs/tests/unit/story_service.stub @@ -12,6 +12,7 @@ import { StoryLocalisationFactory, StoryService, emptyTranslation, + ChapterFactory, type PostedSection, type StorySection, type StoryVersion, @@ -314,6 +315,133 @@ test.group('Story service', (group) => { assert.equal(result!.resources[1].id, first.id); assert.equal(result!.resources[0].title, 'Second Resource'); }); + + test('galleryIndex uses per-locale publish status', async ({ assert }) => { + const story = await StoryFactory.with('localisations').merge({ isPublished: true }).create(); + const sourceLocal = await StoryLocalisation.query() + .where('storyId', story.id) + .where('locale', sourceLocale) + .firstOrFail(); + sourceLocal.isPublished = true; + await sourceLocal.save(); + + await StoryLocalisationFactory.merge({ + storyId: story.id, + locale: translationLocale, + isPublished: false, + title: 'Historia traducida', + }).create(); + + const service = new StoryService(testCmsConfig); + const sourceGallery = await service.galleryIndex(createGalleryHttpContext(sourceLocale)); + const translationGallery = await service.galleryIndex( + createGalleryHttpContext(translationLocale), + ); + + assert.isTrue(sourceGallery.find((item) => item.id === story.id)?.isPublished); + assert.isFalse(translationGallery.find((item) => item.id === story.id)?.isPublished); + }); + + test('editProps and buildUpdatePayload use localisation publish status', async ({ + assert, + }) => { + const story = await StoryFactory.with('localisations').merge({ isPublished: true }).create(); + const sourceLocal = await StoryLocalisation.query() + .where('storyId', story.id) + .where('locale', sourceLocale) + .firstOrFail(); + sourceLocal.isPublished = true; + await sourceLocal.save(); + + await StoryLocalisationFactory.merge({ + storyId: story.id, + locale: translationLocale, + isPublished: false, + title: 'Historia traducida', + coverImage: 'https://example.com/es-cover.jpg', + }).create(); + + const service = new StoryService(testCmsConfig); + const sourceProps = await service.editProps( + createMockHttpContext({ storyId: story.id, locale: sourceLocale }), + ); + const translationProps = await service.editProps( + createMockHttpContext({ storyId: story.id, locale: translationLocale }), + ); + const translationPayload = await service.buildUpdatePayload(story.id, translationLocale); + + assert.isTrue(sourceProps!.model.isPublished); + assert.isFalse(translationProps!.model.isPublished); + assert.isFalse(translationPayload!.isPublished); + }); + + test('blockingPublishMessages counts chapters for the requested locale', async ({ + assert, + }) => { + const story = await StoryFactory.with('localisations') + .merge({ chapterLimit: 1, isPublished: false }) + .create(); + + await ChapterFactory.merge({ + storyId: story.id, + locale: translationLocale, + number: 1, + apiVersion: 1, + }).create(); + + const service = new StoryService(testCmsConfig); + const sourceMessages = await service.blockingPublishMessages( + story, + { + title: 'Ready', + coverImage: 'https://example.com/cover.jpg', + storyType: 'Story', + chapterType: 'Chapter', + visibility: 'public', + }, + sourceLocale, + ); + const translationMessages = await service.blockingPublishMessages( + story, + { + title: 'Listo', + coverImage: 'https://example.com/cover.jpg', + storyType: 'Story', + chapterType: 'Chapter', + visibility: 'public', + }, + translationLocale, + ); + + assert.isAbove(sourceMessages.length, 0); + assert.lengthOf(translationMessages, 0); + }); + + test('homeStories excludes stories unpublished in the requested locale', async ({ + assert, + }) => { + const story = await StoryFactory.with('localisations').merge({ isPublished: true }).create(); + const sourceLocal = await StoryLocalisation.query() + .where('storyId', story.id) + .where('locale', sourceLocale) + .firstOrFail(); + sourceLocal.isPublished = true; + await sourceLocal.save(); + + await StoryLocalisationFactory.merge({ + storyId: story.id, + locale: translationLocale, + isPublished: false, + title: 'Historia traducida', + }).create(); + + const service = new StoryService(testCmsConfig); + const { stories: sourceStories } = await service.homeStories(sourceLocale); + const { stories: translationStories } = await service.homeStories(translationLocale); + + assert.isDefined(sourceStories.find((item) => item.id === story.id)); + assert.isUndefined(translationStories.find((item) => item.id === story.id)); + }); }); test.group('StoryService.prepSections', (group) => { From 12904d81ae5508f459df03a4b785b651f7ab0d46 Mon Sep 17 00:00:00 2001 From: Timothy Koech Date: Thu, 9 Jul 2026 15:55:30 +0300 Subject: [PATCH 2/4] refactor: set default values for storyType and chapterType, and enforce minimum length validation --- src/backend/services/story_service.ts | 4 ++-- src/backend/stubs/tests/unit/story_service.stub | 2 ++ src/backend/validators/story.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/services/story_service.ts b/src/backend/services/story_service.ts index 8816c5c2..917c0b09 100644 --- a/src/backend/services/story_service.ts +++ b/src/backend/services/story_service.ts @@ -131,8 +131,8 @@ export class StoryService { return { model: { chapterLimit: null, - storyType: '', - chapterType: '', + storyType: 'Story', + chapterType: 'Chapter', sectionType: null, visibility: 'public', slug: null, diff --git a/src/backend/stubs/tests/unit/story_service.stub b/src/backend/stubs/tests/unit/story_service.stub index acb4ac1b..3646960e 100644 --- a/src/backend/stubs/tests/unit/story_service.stub +++ b/src/backend/stubs/tests/unit/story_service.stub @@ -151,6 +151,8 @@ test.group('Story service', (group) => { assert.isDefined(props); assert.equal(props!.model.template, 'course'); assert.equal(props!.model.chapterLimit, 10); + assert.equal(props!.model.storyType, 'Story'); + assert.equal(props!.model.chapterType, 'Chapter'); }); test('createProps returns undefined on a translation locale', async ({ assert }) => { diff --git a/src/backend/validators/story.ts b/src/backend/validators/story.ts index b040f360..18adc808 100644 --- a/src/backend/validators/story.ts +++ b/src/backend/validators/story.ts @@ -50,8 +50,8 @@ const createSchema = { description: vine.string().trim().optional(), chapterLimit: vine.number().min(1), tags: vine.string().optional(), - storyType: vine.string().trim().nullable().optional(), - chapterType: vine.string().trim().nullable().optional(), + storyType: vine.string().trim().minLength(1), + chapterType: vine.string().trim().minLength(1), sectionType: vine.string().optional(), visibility: vine.string().trim().optional(), template: vine.string().trim().minLength(1), From 490f9ac71c3e57c40c8e6f92e4619034e85f7ef8 Mon Sep 17 00:00:00 2001 From: Timothy Koech Date: Thu, 9 Jul 2026 15:57:30 +0300 Subject: [PATCH 3/4] test: update validation checks --- tests/unit/story.spec.ts | 174 +++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 52 deletions(-) diff --git a/tests/unit/story.spec.ts b/tests/unit/story.spec.ts index 63370ae3..0550941a 100644 --- a/tests/unit/story.spec.ts +++ b/tests/unit/story.spec.ts @@ -61,6 +61,14 @@ const validCreateData = { template: 'course', }; +const minimalCreateData = { + title: 'Gospel of John', + chapterLimit: 12, + storyType: 'Story', + chapterType: 'Chapter', + template: 'course', +}; + const validDraftUpdateData = { title: 'Gospel of John', description: 'A study through John', @@ -125,6 +133,28 @@ test.describe('Story Validator', () => { ).rejects.toThrow(); }); + test('requires storyType', async () => { + const validator = new StoryCreateValidator(); + + await expect( + validator.validate({ + ...validCreateData, + storyType: '', + }), + ).rejects.toThrow(); + }); + + test('requires chapterType', async () => { + const validator = new StoryCreateValidator(); + + await expect( + validator.validate({ + ...validCreateData, + chapterType: '', + }), + ).rejects.toThrow(); + }); + test('accepts valid create payload', async () => { const validator = new StoryCreateValidator(); const result = await validator.validate(validCreateData); @@ -144,66 +174,52 @@ test.describe('Story Validator', () => { test('accepts minimal create payload', async () => { const validator = new StoryCreateValidator(); - const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - }); + const result = await validator.validate(minimalCreateData); expect(result.bundle.title).toBe('Gospel of John'); expect(result.bundle.chapterLimit).toBe(12); + expect(result.bundle.storyType).toBe('Story'); + expect(result.bundle.chapterType).toBe('Chapter'); expect(result.bundle.template).toBe('course'); }); - test('accepts blank storyType, chapterType, visibility', async () => { + test('accepts blank visibility', async () => { const validator = new StoryCreateValidator(); const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - storyType: '', - chapterType: '', + ...minimalCreateData, visibility: '', }); - expect(result.bundle.storyType).toBe(''); - expect(result.bundle.chapterType).toBe(''); expect(result.bundle.visibility).toBe(''); }); - test('accepts null storyType and chapterType', async () => { + test('rejects null storyType and chapterType', async () => { const validator = new StoryCreateValidator(); - const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - storyType: null, - chapterType: null, - }); - expect(result.bundle.storyType).toBeNull(); - expect(result.bundle.chapterType).toBeNull(); + await expect( + validator.validate({ + ...minimalCreateData, + storyType: null, + chapterType: null, + }), + ).rejects.toThrow(); }); - test('accepts omitted storyType and chapterType', async () => { + test('rejects omitted storyType and chapterType', async () => { const validator = new StoryCreateValidator(); - const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - }); - expect(result.bundle.storyType).toBeUndefined(); - expect(result.bundle.chapterType).toBeUndefined(); + await expect( + validator.validate({ + title: 'Gospel of John', + chapterLimit: 12, + template: 'course', + }), + ).rejects.toThrow(); }); test('accepts create without sections or resources', async () => { const validator = new StoryCreateValidator(); - const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - }); + const result = await validator.validate(minimalCreateData); expect(result.bundle.sections).toBeUndefined(); expect(result.bundle.resources).toBeUndefined(); @@ -212,9 +228,7 @@ test.describe('Story Validator', () => { test('accepts create with sections and resources', async () => { const validator = new StoryCreateValidator(); const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', + ...minimalCreateData, sections: [{ title: 'Introduction', description: 'Opening section' }], resources: ['00000000-0000-0000-0000-000000000001'], }); @@ -231,9 +245,7 @@ test.describe('Story Validator', () => { await expect( validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', + ...minimalCreateData, sections: [{ title: '' }], }), ).rejects.toThrow(); @@ -363,6 +375,42 @@ test.describe('Story Validator', () => { ); }); + test('create returns friendly storyType message for empty storyType', async () => { + const validator = new StoryCreateValidator(); + + await expectValidationMessages( + () => + validator.validate({ + ...validCreateData, + storyType: '', + }), + [ + { + field: 'bundle.storyType', + message: 'Please choose a story type.', + }, + ], + ); + }); + + test('create returns friendly storyType message for null storyType', async () => { + const validator = new StoryCreateValidator(); + + await expectValidationMessages( + () => + validator.validate({ + ...validCreateData, + storyType: null, + }), + [ + { + field: 'bundle.storyType', + message: 'Please choose a story type.', + }, + ], + ); + }); + test('update returns friendly storyType message for empty storyType', async () => { const data = { ...validDraftUpdateData, @@ -401,18 +449,40 @@ test.describe('Story Validator', () => { ); }); - test('create accepts null storyType and chapterType', async () => { + test('create returns friendly chapterType message for empty chapterType', async () => { const validator = new StoryCreateValidator(); - const result = await validator.validate({ - title: 'Gospel of John', - chapterLimit: 12, - template: 'course', - storyType: null, - chapterType: null, - }); - expect(result.bundle.storyType).toBeNull(); - expect(result.bundle.chapterType).toBeNull(); + await expectValidationMessages( + () => + validator.validate({ + ...validCreateData, + chapterType: '', + }), + [ + { + field: 'bundle.chapterType', + message: 'Please choose a chapter type.', + }, + ], + ); + }); + + test('create returns friendly chapterType message for null chapterType', async () => { + const validator = new StoryCreateValidator(); + + await expectValidationMessages( + () => + validator.validate({ + ...validCreateData, + chapterType: null, + }), + [ + { + field: 'bundle.chapterType', + message: 'Please choose a chapter type.', + }, + ], + ); }); test('update returns friendly chapterType message for empty chapterType', async () => { From 5d917180be5b63e2732ecee6fe6c693a5e0beffc Mon Sep 17 00:00:00 2001 From: Jannie Theunissen Date: Fri, 10 Jul 2026 14:23:38 +0200 Subject: [PATCH 4/4] refactor: story service method signature --- src/backend/services/story_service.ts | 8 ++++---- src/backend/stubs/controllers/stories_controller.stub | 4 ++-- src/backend/stubs/tests/unit/story_service.stub | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/services/story_service.ts b/src/backend/services/story_service.ts index 917c0b09..355c992b 100644 --- a/src/backend/services/story_service.ts +++ b/src/backend/services/story_service.ts @@ -51,14 +51,13 @@ export class StoryService { } public async blockingPublishMessages( + locale: string, story: Story, metadata?: StoryPublishMetadata, - locale?: string, ): Promise { - const publishLocale = locale ?? this.config.languages[0].locale; const localeChapters = await Chapter.query() .where('storyId', story.id) - .where('locale', publishLocale); + .where('locale', locale); const messages: string[] = []; @@ -449,7 +448,8 @@ export class StoryService { } protected localisationIsPublished( - localisation?: Pick | Partial | null, + localisation?: + Pick | Partial | null, ): boolean { return localisation?.isPublished === true; } diff --git a/src/backend/stubs/controllers/stories_controller.stub b/src/backend/stubs/controllers/stories_controller.stub index f2bfe2c1..90c2bdef 100644 --- a/src/backend/stubs/controllers/stories_controller.stub +++ b/src/backend/stubs/controllers/stories_controller.stub @@ -128,6 +128,7 @@ export default class StoriesController { if (payload.isPublished) { const messages = await storyService.blockingPublishMessages( + version.locale, story, { title: payload.title, @@ -136,7 +137,6 @@ export default class StoriesController { chapterType: payload.chapterType, visibility: payload.visibility, }, - version.locale, ); if (messages.length > 0) { ctx.session.flash('errorsBag', { other: messages.join(' | ') }); @@ -167,6 +167,7 @@ export default class StoriesController { const model = await Story.findOrFail(version.storyId); const messages = await storyService.blockingPublishMessages( + version.locale, model, { title: payload.title, @@ -175,7 +176,6 @@ export default class StoriesController { chapterType: payload.chapterType, visibility: payload.visibility, }, - version.locale, ); if (messages.length > 0) { ctx.session.flash('errorsBag', { other: messages.join(' | ') }); diff --git a/src/backend/stubs/tests/unit/story_service.stub b/src/backend/stubs/tests/unit/story_service.stub index 3646960e..0b2aa8ef 100644 --- a/src/backend/stubs/tests/unit/story_service.stub +++ b/src/backend/stubs/tests/unit/story_service.stub @@ -393,6 +393,7 @@ test.group('Story service', (group) => { const service = new StoryService(testCmsConfig); const sourceMessages = await service.blockingPublishMessages( + sourceLocale, story, { title: 'Ready', @@ -401,9 +402,9 @@ test.group('Story service', (group) => { chapterType: 'Chapter', visibility: 'public', }, - sourceLocale, ); const translationMessages = await service.blockingPublishMessages( + translationLocale, story, { title: 'Listo', @@ -412,7 +413,6 @@ test.group('Story service', (group) => { chapterType: 'Chapter', visibility: 'public', }, - translationLocale, ); assert.isAbove(sourceMessages.length, 0);