angular.js/i18n/e2e/i18n-e2e.js
Di Peng 966cbd4cf8 feat(i18n): collect and convert locale info from closure
- add i18n/closure directory with closure i18n files and
  update-closure.sh script to update them
- generate.sh script runs node.js scripts that extract localization
  rules from the closure library, transform them to a more suitable
format and dumps them into i18n/locale directory as angular's $locale
services
- update Rakefile to copy i18n files to build/ and pkg/ dirs
- copy i18n stuff during rake build
- e2e tests for several locales
2011-08-14 23:44:20 -07:00

79 lines
3 KiB
JavaScript

describe("localized filters", function() {
describe("es locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_es.html");
});
it('should check filters for es locale', function() {
expect(binding('input | date:"medium"')).toBe('03/06/1977 18:07:23');
expect(binding('input | date:"longDate"')).toBe("3 de junio de 1977");
expect(binding('input | number')).toBe('234.234.443.432');
expect(binding('input | currency')).toBe('€ 234.234.443.432,00');
});
});
describe("cs locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_cs.html");
});
it('should check filters for cs locale', function() {
expect(binding('input | date:"medium"')).toBe('3.6.1977 18:07:23');
expect(binding('input | date:"longDate"')).toBe("3. června 1977");
expect(binding('input | number')).toBe('234 234 443 432');
expect(binding('input | currency')).toBe('234 234 443 432,00 K\u010d');
});
});
describe("de locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_de.html");
});
it('should check filters for de locale', function() {
expect(binding('input | date:"medium"')).toBe('03.06.1977 18:07:23');
expect(binding('input | date:"longDate"')).toBe("3. Juni 1977");
expect(binding('input | number')).toBe('234.234.443.432');
expect(binding('input | currency')).toBe('234.234.443.432,00 €');
});
});
describe("en locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_en.html");
});
it('should check filters for en locale', function() {
expect(binding('input | date:"medium"')).toBe('Jun 3, 1977 6:07:23 PM');
expect(binding('input | date:"longDate"')).toBe("June 3, 1977");
expect(binding('input | number')).toBe('234,234,443,432');
expect(binding('input | currency')).toBe('$234,234,443,432.00');
});
});
describe("sk locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_sk.html");
});
it('should check filters for sk locale', function() {
expect(binding('input | date:"medium"')).toBe('3.6.1977 18:07:23');
expect(binding('input | date:"longDate"')).toBe("3. júna 1977");
expect(binding('input | number')).toBe('234 234 443 432');
expect(binding('input | currency')).toBe('234 234 443 432,00 Sk');
});
});
describe("zh locale", function() {
beforeEach(function() {
browser().navigateTo("localeTest_zh.html");
});
it('should check filters for zh locale', function() {
expect(binding('input | date:"medium"')).toBe('1977-6-3 下午6:07:23');
expect(binding('input | date:"longDate"')).toBe("1977年6月3日");
expect(binding('input | number')).toBe('234,234,443,432');
expect(binding('input | currency')).toBe('¥234,234,443,432.00');
});
});
});