mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: translation
This commit is contained in:
parent
fa8a433a64
commit
8707b861b4
@ -141,7 +141,9 @@ describe('TranslationController', () => {
|
|||||||
translationController = module.get<TranslationController>(
|
translationController = module.get<TranslationController>(
|
||||||
TranslationController,
|
TranslationController,
|
||||||
);
|
);
|
||||||
translation = await translationService.findOne({ str: 'Welcome' });
|
translation = (await translationService.findOne({
|
||||||
|
str: 'Welcome',
|
||||||
|
})) as Translation;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(jest.clearAllMocks);
|
afterEach(jest.clearAllMocks);
|
||||||
@ -164,7 +166,9 @@ describe('TranslationController', () => {
|
|||||||
|
|
||||||
expect(translationService.findOne).toHaveBeenCalledWith(translation.id);
|
expect(translationService.findOne).toHaveBeenCalledWith(translation.id);
|
||||||
expect(result).toEqualPayload(
|
expect(result).toEqualPayload(
|
||||||
translationFixtures.find(({ str }) => str === translation.str),
|
translationFixtures.find(
|
||||||
|
({ str }) => str === translation.str,
|
||||||
|
) as Translation,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -100,6 +100,7 @@ export class TranslationService extends BaseService<Translation> {
|
|||||||
}
|
}
|
||||||
// Add fallback messages
|
// Add fallback messages
|
||||||
if (
|
if (
|
||||||
|
block.options &&
|
||||||
'fallback' in block.options &&
|
'fallback' in block.options &&
|
||||||
block.options.fallback &&
|
block.options.fallback &&
|
||||||
'message' in block.options.fallback &&
|
'message' in block.options.fallback &&
|
||||||
|
Loading…
Reference in New Issue
Block a user