it('should return the default if handed an empty string', () => {
   expect(utils.sanitizeLanguage('')).toEqual('en-US');
 });
 it('should return a lang if handed a locale', () => {
   expect(utils.sanitizeLanguage('en_US')).toEqual('en-US');
 });
 it('should return the default if handed undefined', () => {
   expect(utils.sanitizeLanguage(undefined)).toEqual(defaultLang);
 });
 it('should return the default if lookup not present', () => {
   expect(utils.sanitizeLanguage('awooga')).toEqual(defaultLang);
 });
 it('should return the default if bad type', () => {
   expect(utils.sanitizeLanguage(1)).toEqual(defaultLang);
 });
 it('should get a standard language ', () => {
   expect(utils.sanitizeLanguage('ar')).toEqual('ar');
 });
 it('should convert short form lang to longer', () => {
   expect(utils.sanitizeLanguage('en')).toEqual('en-US');
 });
 it('should return the default if handed undefined', () => {
   assert.equal(utils.sanitizeLanguage(undefined), defaultLang);
 });
 it('should return the default if handed an empty string', () => {
   assert.equal(utils.sanitizeLanguage(''), 'en-US');
 });
Example #10
0
 it('should return a lang if handed a locale', () => {
   assert.equal(utils.sanitizeLanguage('en_US'), 'en-US');
 });
Example #11
0
 it('should return the default if bad type', () => {
   assert.equal(utils.sanitizeLanguage(1), defaultLang);
 });
Example #12
0
 it('should return the default if lookup not present', () => {
   assert.equal(utils.sanitizeLanguage('awooga'), defaultLang);
 });
Example #13
0
 it('should convert short form lang to longer', () => {
   assert.equal(utils.sanitizeLanguage('en'), 'en-US');
 });
Example #14
0
 it('should get a standard language ', () => {
   assert.equal(utils.sanitizeLanguage('ar'), 'ar');
 });