1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-10 04:07:35 +02:00

Fixig backendtext tests #683

This commit is contained in:
Patrik J. Braun 2023-07-30 13:04:23 +02:00
parent 015a0221c2
commit e113062208
3 changed files with 13 additions and 11 deletions

View File

@ -4,11 +4,11 @@ export const backendTexts = {
sizeToGenerate: {name: 20, description: 22},
indexChangesOnly: {name: 30, description: 32},
searchQuery: {name: 40, description: 42},
sortBy: {name: 100, description: 102},
pickAmount: {name: 50, description: 52},
emailTo: {name: 60, description: 62},
emailFrom: {name: 70, description: 72},
emailSubject: {name: 80, description: 82},
emailText: {name: 90, description: 92}
sortBy: {name: 50, description: 52},
pickAmount: {name: 60, description: 62},
emailTo: {name: 70, description: 72},
emailFrom: {name: 80, description: 82},
emailSubject: {name: 90, description: 92},
emailText: {name: 100, description: 102}
};

View File

@ -1,6 +1,6 @@
import { inject, TestBed } from '@angular/core/testing';
import { BackendtextService } from './backendtext.service';
import { backendTexts } from '../../../common/BackendTexts';
import {inject, TestBed} from '@angular/core/testing';
import {BackendtextService} from './backendtext.service';
import {backendTexts} from '../../../common/BackendTexts';
describe('BackendTextService', () => {
beforeEach(() => {
@ -9,7 +9,7 @@ describe('BackendTextService', () => {
});
});
it('should call UserDTO service login', inject(
it('should have valid text for all keys', inject(
[BackendtextService],
(backendTextService: BackendtextService) => {
const getTexts = (obj: any) => {
@ -18,7 +18,7 @@ describe('BackendTextService', () => {
getTexts(obj[key]);
continue;
}
expect(backendTextService.get(obj[key])).not.toBe(null);
expect(backendTextService.get(obj[key])).not.toEqual(null, 'Error for key: ' + obj[key] +', ' + key);
}
};
getTexts(backendTexts);

View File

@ -17,6 +17,8 @@ export class BackendtextService {
return $localize`Only checks indexed files.`;
case backendTexts.indexChangesOnly.name:
return $localize`Index changes only`;
case backendTexts.indexChangesOnly.description:
return $localize`Only indexes a folder if it got changed.`;
case backendTexts.searchQuery.name:
return $localize`Search query`;
case backendTexts.searchQuery.description: