This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
/
Copy pathi18n-e2e.js
187 lines (144 loc) · 6.99 KB
/
i18n-e2e.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
'use strict';
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('€\u00a0234.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\u00a0234\u00a0443\u00a0432');
expect(binding('input | currency')).toBe('234\u00a0234\u00a0443\u00a0432,00\u00a0K\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\u00a0€');
});
});
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('ng:pluralize for en locale', function() {
it('should show pluralized strings', function() {
expect(element('ng-pluralize:first').html()).toBe('You have one email!');
input('plInput').enter('0');
expect(element('ng-pluralize:first').html()).toBe('You have no email!');
input('plInput').enter('3');
expect(element('ng-pluralize:first').html()).toBe('You have 3 emails!');
});
it('should show pluralized strings with offsets', function() {
expect(element('ng-pluralize:last').html()).toBe('Shanjian is viewing!');
input('plInput2').enter('0');
expect(element('ng-pluralize:last').html()).toBe('Nobody is viewing!');
input('plInput2').enter('2');
expect(element('ng-pluralize:last').html()).toBe('Shanjian and Di are viewing!');
input('plInput2').enter('3');
expect(element('ng-pluralize:last').html()).
toBe('Shanjian, Di and one other person are viewing!');
input('plInput2').enter('4');
expect(element('ng-pluralize:last').html()).
toBe('Shanjian, Di and 2 other people are viewing!');
});
it('should show pluralized strings with correct data-binding', function() {
input('plInput2').enter('2');
expect(element('ng-pluralize:last').html()).toBe('Shanjian and Di are viewing!');
input('person1').enter('Igor');
expect(element('ng-pluralize:last').html()).toBe('Igor and Di are viewing!');
input('person2').enter('Vojta');
expect(element('ng-pluralize:last').html()).toBe('Igor and Vojta are viewing!');
});
});
});
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\u00a0234\u00a0443\u00a0432');
expect(binding('input | currency')).toBe('234\u00a0234\u00a0443\u00a0432,00\u00a0Sk');
});
describe('ng:pluralize for sk locale', function() {
it('should show pluralized strings', function() {
expect(element('ng-pluralize').html()).toBe('Mas jeden email!');
input('plInput').enter('0');
expect(element('ng-pluralize:first').html()).toBe('Mas 0 emailov!');
input('plInput').enter('3');
expect(element('ng-pluralize:first').html()).toBe('Mas 3 emaily!');
input('plInput').enter('4');
expect(element('ng-pluralize:first').html()).toBe('Mas 4 emaily!');
input('plInput').enter('6');
expect(element('ng-pluralize:first').html()).toBe('Mas 6 emailov!');
});
it('should show pluralized strings with offsets', function() {
//TODO(Igor): add offsets for sk
});
it('should show pluralized strings with correct data-binding', function() {
});
});
});
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');
});
describe('ng:pluralize for zh locale', function() {
it('should show pluralized strings', function() {
expect(element('ng-pluralize:first').html()).toBe('1人在浏览该文件!');
input('plInput').enter('0');
expect(element('ng-pluralize:first').html()).toBe('0人在浏览该文件!');
input('plInput').enter('3');
expect(element('ng-pluralize:first').html()).toBe('3人在浏览该文件!');
});
it('should show pluralized strings with offsets', function() {
expect(element('ng-pluralize:last').html()).toBe('Shanjian 在浏览该文件!');
input('plInput2').enter('0');
expect(element('ng-pluralize:last').html()).toBe('没有人在浏览该文件!');
input('plInput2').enter('2');
expect(element('ng-pluralize:last').html()).toBe('Shanjian 和 Di 在浏览该文件!');
input('plInput2').enter('3');
expect(element('ng-pluralize:last').html()).
toBe('Shanjian, Di 还有其他1 人在浏览该文件!');
});
it('should show pluralized strings with correct data-binding', function() {
input('plInput2').enter('2');
expect(element('ng-pluralize:last').html()).toBe('Shanjian 和 Di 在浏览该文件!');
input('person1').enter('彭迪');
expect(element('ng-pluralize:last').html()).toBe('彭迪 和 Di 在浏览该文件!');
input('person2').enter('一哥');
expect(element('ng-pluralize:last').html()).toBe('彭迪 和 一哥 在浏览该文件!');
});
});
});
});