aboutsummaryrefslogtreecommitdiffstats
path: root/i18n/spec/utilSpec.js
blob: e6304254c41c847a061151318752e7c8d704bffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var util = require('../src/util.js');

describe('findLocaleId', function() {
  it('should find localeId', function() {
    expect(util.findLocaleId('', 'num')).toBeUndefined();
    expect(util.findLocaleId('aa', 'datetime')).toBeUndefined();
    expect(util.findLocaleId('aa', 'randomType')).toBeUndefined();
    expect(util.findLocaleId('NumberFormatSymbols_en', 'datetime')).toBeUndefined();
    expect(util.findLocaleId('DateTimeSymbols_en', 'num')).toBeUndefined();

    expect(util.findLocaleId('DateTimeSymbols_en', 'datetime')).toBe('en');
    expect(util.findLocaleId('NumberFormatSymbols_en_US', 'num')).toBe('en_US');
  });
});