feat: implement tests and coverage reports for KpiCards and scrapeLakes functionality

This commit is contained in:
David Fencl
2026-06-05 23:08:44 +02:00
parent 0030dca448
commit 8193ce818a
37 changed files with 4309 additions and 31 deletions
+34
View File
@@ -0,0 +1,34 @@
import { describe, it, expect } from 'vitest';
import { t } from '../translations';
describe('Translations', () => {
it('should have exactly the same keys in English and Czech', () => {
const enKeys = Object.keys(t.en).sort();
const csKeys = Object.keys(t.cs).sort();
expect(enKeys).toEqual(csKeys);
// Deep check for nested keys
for (const key of enKeys) {
const enSubKeys = Object.keys((t.en as any)[key]).sort();
const csSubKeys = Object.keys((t.cs as any)[key]).sort();
expect(enSubKeys).toEqual(csSubKeys);
}
});
it('should not have empty translation strings', () => {
const checkEmpty = (obj: any) => {
for (const val of Object.values(obj)) {
if (typeof val === 'string') {
expect(val.length).toBeGreaterThan(0);
} else if (typeof val === 'object') {
checkEmpty(val);
}
}
};
checkEmpty(t.en);
checkEmpty(t.cs);
});
});