fix: minor changes

This commit is contained in:
abdou6666 2024-11-22 14:27:24 +01:00
parent 628d0f5819
commit 7d3a92e1d6
3 changed files with 4 additions and 12 deletions

View File

@ -73,7 +73,7 @@ describe('TranslationService', () => {
find: jest.fn().mockResolvedValue([
{
translatable: false,
global_fallback: 'global_fallback',
label: 'global_fallback',
fallback_message: ['Global fallback message'],
},
]),
@ -175,7 +175,6 @@ describe('TranslationService', () => {
fallback_message: ['Global fallback message'],
},
} as Settings);
const strings = await service.getSettingStrings();
expect(strings).toEqual([]);
});

View File

@ -140,8 +140,9 @@ export class TranslationService extends BaseService<Translation> {
return Object.values(settings)
.map((group: Record<string, string | string[]>) => Object.entries(group))
.flat()
.filter(([l]) => {
return translatableSettings.find(({ label }) => label === l);
.filter(([l, value]) => {
const found = translatableSettings.find(({ label }) => label === l);
return found && !!value;
})
.map(([, v]) => v)
.flat();

View File

@ -20,14 +20,6 @@ export const settingFixtures: SettingCreateDto[] = [
type: SettingType.text,
weight: 1,
},
{
group: 'contact',
label: 'greeting',
value: 'hello',
type: SettingType.text,
weight: 10,
translatable: true,
},
{
group: 'contact',
label: 'company_name',