Skip to content

Commit be44fcb

Browse files
authored
test(i18n): verify locale labels are non-empty (JhaSourav07#1686)
## Description Adds a test to verify that all locale label values are non-empty strings. The test iterates through all locales dynamically using the exported `labels` object and ensures that every label value: - Is a string - Is not empty Fixes JhaSourav07#656 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only change, no SVG/UI changes) ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally. - [x] I have run `npm run format` and `npm run lint` locally. - [x] My commits follow the Conventional Commits format. - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have starred the repo. - [x] I have made sure that I have only one commit to merge in this PR. - [x] The change does not affect SVG output. - [ ] (Recommended) I joined the CommitPulse Discord server.
2 parents 6073d17 + 2f33ad1 commit be44fcb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/i18n/badgeLabels.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import { getLabels } from './badgeLabels';
2+
import { getLabels, labels } from './badgeLabels';
33

44
describe('getLabels', () => {
55
describe('supported locales', () => {
@@ -61,5 +61,13 @@ describe('getLabels', () => {
6161
expect(typeof labels.ANNUAL_SYNC_TOTAL).toBe('string');
6262
expect(typeof labels.PEAK_STREAK).toBe('string');
6363
});
64+
it('ensures all locale labels are non-empty strings', () => {
65+
for (const locale of Object.values(labels)) {
66+
for (const value of Object.values(locale)) {
67+
expect(typeof value).toBe('string');
68+
expect(value.length).toBeGreaterThan(0);
69+
}
70+
}
71+
});
6472
});
6573
});

0 commit comments

Comments
 (0)