The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { APP_LOCALES } from '@/translations';
import { isValidLocale } from '@/utils/validation/isValidLocale';
describe('isValidLocale', () => {
it('should return true for valid locales', () => {
Object.keys(APP_LOCALES).forEach((locale) => {
expect(isValidLocale(locale)).toBe(true);
});
});
it('should return false for invalid locales', () => {
expect(isValidLocale('invalidLocale')).toBe(false);
expect(isValidLocale(null)).toBe(false);
});
it('should return false for inherited Object prototype keys', () => {
expect(isValidLocale('toString')).toBe(false);
expect(isValidLocale('constructor')).toBe(false);
});
});