From 8913d81abc454dbdb6085e4705e35e389ad709e7 Mon Sep 17 00:00:00 2001 From: Kevin Drouvin Date: Fri, 18 Jan 2019 14:29:23 +0100 Subject: [PATCH] test(moment-adapter): use arabic locale for testing localized dates Use a locale with localized date & year values different from the english (default locale) values. Fix invalid tests description. --- src/lib/core/datetime/native-date-adapter.spec.ts | 2 +- .../adapter/moment-date-adapter.spec.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/core/datetime/native-date-adapter.spec.ts b/src/lib/core/datetime/native-date-adapter.spec.ts index ddd4d29aeb47..7a165a8edf24 100644 --- a/src/lib/core/datetime/native-date-adapter.spec.ts +++ b/src/lib/core/datetime/native-date-adapter.spec.ts @@ -54,7 +54,7 @@ describe('NativeDateAdapter', () => { ]); }); - it('should get long month names', () => { + it('should get short month names', () => { expect(adapter.getMonthNames('short')).toEqual([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]); diff --git a/src/material-moment-adapter/adapter/moment-date-adapter.spec.ts b/src/material-moment-adapter/adapter/moment-date-adapter.spec.ts index 10548e902f5d..237f0e28b270 100644 --- a/src/material-moment-adapter/adapter/moment-date-adapter.spec.ts +++ b/src/material-moment-adapter/adapter/moment-date-adapter.spec.ts @@ -66,7 +66,7 @@ describe('MomentDateAdapter', () => { ]); }); - it('should get long month names', () => { + it('should get short month names', () => { expect(adapter.getMonthNames('short')).toEqual([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]); @@ -93,10 +93,10 @@ describe('MomentDateAdapter', () => { }); it('should get date names in a different locale', () => { - adapter.setLocale('ja-JP'); + adapter.setLocale('ar-AE'); expect(adapter.getDateNames()).toEqual([ - '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' + '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩', '١٠', '١١', '١٢', '١٣', '١٤', '١٥', '١٦', + '١٧', '١٨', '١٩', '٢٠', '٢١', '٢٢', '٢٣', '٢٤', '٢٥', '٢٦', '٢٧', '٢٨', '٢٩', '٣٠', '٣١' ]); }); @@ -130,8 +130,8 @@ describe('MomentDateAdapter', () => { }); it('should get year name in a different locale', () => { - adapter.setLocale('ja-JP'); - expect(adapter.getYearName(moment([2017, JAN, 1]))).toBe('2017'); + adapter.setLocale('ar-AE'); + expect(adapter.getYearName(moment([2017, JAN, 1]))).toBe('٢٠١٧'); }); it('should get first day of week', () => {