Skip to content

Commit a06dad1

Browse files
kdrvnandrewseguin
authored andcommitted
test(moment-adapter): use arabic locale for testing localized dates (#14883)
Use a locale with localized date & year values different from the english (default locale) values. Fix invalid tests description.
1 parent 9533055 commit a06dad1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lib/core/datetime/native-date-adapter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('NativeDateAdapter', () => {
5454
]);
5555
});
5656

57-
it('should get long month names', () => {
57+
it('should get short month names', () => {
5858
expect(adapter.getMonthNames('short')).toEqual([
5959
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
6060
]);

src/material-moment-adapter/adapter/moment-date-adapter.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('MomentDateAdapter', () => {
6666
]);
6767
});
6868

69-
it('should get long month names', () => {
69+
it('should get short month names', () => {
7070
expect(adapter.getMonthNames('short')).toEqual([
7171
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
7272
]);
@@ -93,10 +93,10 @@ describe('MomentDateAdapter', () => {
9393
});
9494

9595
it('should get date names in a different locale', () => {
96-
adapter.setLocale('ja-JP');
96+
adapter.setLocale('ar-AE');
9797
expect(adapter.getDateNames()).toEqual([
98-
'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',
99-
'18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'
98+
'١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩', '١٠', '١١', '١٢', '١٣', '١٤', '١٥', '١٦',
99+
'١٧', '١٨', '١٩', '٢٠', '٢١', '٢٢', '٢٣', '٢٤', '٢٥', '٢٦', '٢٧', '٢٨', '٢٩', '٣٠', '٣١'
100100
]);
101101
});
102102

@@ -130,8 +130,8 @@ describe('MomentDateAdapter', () => {
130130
});
131131

132132
it('should get year name in a different locale', () => {
133-
adapter.setLocale('ja-JP');
134-
expect(adapter.getYearName(moment([2017, JAN, 1]))).toBe('2017');
133+
adapter.setLocale('ar-AE');
134+
expect(adapter.getYearName(moment([2017, JAN, 1]))).toBe('٢٠١٧');
135135
});
136136

137137
it('should get first day of week', () => {

0 commit comments

Comments
 (0)